I use argv to pass in unique arguments to python scripts while in terminal. Very useful when running same program on multiple unique files (this program parses an xml file for certain things). I have built three different programs that serve unique purposes.
I am aggregating my programs to one .py file so that I can use 'import' within the actual running instance of python and then go one by one through the files:
>>>import xml
>>>xml.a()
>>>xml.b()
>>>xml.c()
How can I pass arguments to these programs on the fly? I'm getting a syntax error when I place the arguments after calling the program in this way.
>>>xml.a() file1.xml file1.csv
^
>>>SyntaxError: invalid syntax
1... andsys.argvis for programs run outside the python interpreter. In the interpreter, there are only parameters.