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.”
image

• Press the Ctrl and N key to create a new file.
image

• Select “Select a Language.”
image

• Type “python” in the search box and select “Python (python)” from the result.
image

• Type import pandas as pd and press the Enter key to import the Pandas module as the pd variable.
image

• Type from openpyxl.workbook import Workbook and press the Enter key twice to import the Workbook object from the openpxl.workbook module.
image

• Type df_txt = pd.read_csv(‘< text file >.txt’, delimiter=’\t’) and press the Enter key twice to define dataframe for the text file.
image

• Type print(df_txt) and press the Enter key to print the text file.
image

• Press the Ctrl and S keys to save the file.
image

• Browse to where you want to save the file, type the filename in the “File name:” box and select “Save.”
image

• Press the Run button and the contents of the text file will print in the TERMINAL.
image

⚠️ **GitHub.com Fallback** ⚠️