I want to use arguments which will then be translated into variable that will hold a value:
I get some values from a CSV file then upload it to Googles' Sheet Docs.
Here is a snippet of my code [mycode.py]:
f101 = open('/home/some_directory/101_Hrs.csv')
f102 = open('/home/some_directory/102_Hrs.csv')
f103 = open('/home/some_directory/103_Hrs.csv')
f112 = open('/home/some_directory/112_Hrs.csv')
csv_f101 = csv.reader(f101)
csv_f102 = csv.reader(f102)
csv_f103 = csv.reader(f103)
csv_f112 = csv.reader(f112)
I want to use an argument (101,102,103 or 112) from the terminal (for example mycode.py 101), where I can use the [101] to be concatenated with the f to getf101 and also open('/home/some_directory/[101]_Hrs.csv') where [101] is a number that can be replaced by the argument from the terminal.
How is this done?
os.walk()with aloopmake you happy.