the text beforehand states "For instance the following output results from running python demo.py one two three at the command line" which to me means the output should be shown without the leading >>>'s.
On Thu, Jul 14, 2022, at 6:44 PM, Runbing wrote:
I saw a pice of code about “command line argument”:
import sys print(sys.argv)
['demo.py', 'one', 'two', 'three']
on this page:
It shows how to get a list of parameters and looks like it's in interactive mode.
But I can't do the same thing in interactive mode, sys.argv is always return empty list, unless I put these code in a script and execute it.
Does this mean this sample code not too clear?
Runbing _______________________________________________ docs mailing list -- firstname.lastname@example.org To unsubscribe send an email to email@example.com https://mail.python.org/mailman3/lists/docs.python.org/ Member address: firstname.lastname@example.org