Oct-11-2020, 10:29 AM
sys.argv is a list of arguments passed when you start your program. sys.argv[0] is the name of your program. The rest are the parameters.
If your program, say demo.py is:
... and you start your program with parameters:
... then your output will be:
If your program, say demo.py is:
import sys print(sys.argv)
... and you start your program with parameters:
./demo.py a b c
... then your output will be:
Output:['./demo.py', 'a', 'b', 'c']