I wrote a code that starts with
import pandas as pd
# Code starts by reading one txt file
df=pd.read_fwf(r'C:\Users\youngrakchoi\Desktop\.filename.txt',sep='')
#-------My code--------#
# Code ends with saving the results
VOLTAGE_fin.to_excel(r'C:\Users\youngrakchoi\Desktop\NAME.xlsx')
Now I would like to run this code to all files saved in specific directory(folder) and save the file as the original file name (eg. save VOLTAGE_fin as 'filename').
Could anybody help me to solve this issue?