Print Text File in Python with Visual Studio Code on Windows - DevPops-Inc/windows GitHub Wiki
• Press the Windows key, type “visual studio code” and select “Open.”
•
• Press the Ctrl and N key to create a new file.
•
• Select “Select a Language.”
•
• Type “python” in the search box and select “Python (python)” from the result.
•
• Type import pandas as pd
and press the Enter key to import the Pandas module as the pd
variable.
•
• Type from openpyxl.workbook import Workbook
and press the Enter key twice to import the Workbook
object from the openpxl.workbook
module.
•
• Type df_txt = pd.read_csv(‘< text file >.txt’, delimiter=’\t’)
and press the Enter key twice to define dataframe for the text file.
•
• Type print(df_txt)
and press the Enter key to print the text file.
•
• Press the Ctrl and S keys to save the file.
•
• Browse to where you want to save the file, type the filename in the “File name:” box and select “Save.”
•
• Press the Run button and the contents of the text file will print in the TERMINAL.
•