I\'m currently teaching myself Python and was just wondering (In reference to my example below) in simplified terms what the sys.argv[1]
represents. Is it simpl
Just adding to Frederic's answer, for example if you call your script as follows:
./myscript.py foo bar
sys.argv[0]
would be "./myscript.py"
sys.argv[1]
would be "foo" and
sys.argv[2]
would be "bar" ... and so forth.
In your example code, if you call the script as follows ./myscript.py foo
, the script's output will be "Hello there foo".