I have a python (pandas) script that reads csv files into a dataframe, edits them, and makes them into a new csv (output):
import pandas as pd
df = pd.read_csv(r'\filename.csv', sep=',')
# I skipped over the dataframe edits
try:
df.to_csv(r'outputfilename', sep='\t', encoding='utf-8')
except IOError as e:
print('Could not make Excel file' % e)`
I would like to use it on multiple csv files at once and get multiple outputs (csv's):
I have tried:
from tkinter.filedialog import askopenfilename
filename = askopenfilename()
df = pd.read_csv(filename, sep=',')
...
and it works (gives me an selection window), but I am only able to choose one file