I am working with CSV file and in my code, for every CSV file that I want to process, I should change the input file name manually and it is taking some times to do that every time.
My code looks as follow:
import pandas as pd
file = pd.read_csv('data_0.csv', error_bad_lines=False);
I want to use the command line argument, to make the process easier and enter any CSV file that I want as an input.
for example:
python code.py data_0.csv
save by desire name. for example:
python code.py data_0.csv output_0.csv
Now, I already read many posts such as 1, 2, 3, but I am not sure which one is faster and easier. Python documentation has many options such as sys.arg
or argparse
but I couldn't able to do it.
Thanks