Access to sys.argv when python interpreter is invoked in some modes like 'python -c "command"'

poggle.themammal at gmail.com poggle.themammal at gmail.com
Sun Aug 20 14:16:00 EDT 2006


The python tutorial says
"When the script name is given as '-' (meaning standard input),
sys.argv[0] is set to '-'. When -c command is used, sys.argv[0] is
set to '-c'. " but when we use a command say 'python -c "command"'
where can we access "sys.argv"  (are there some commands where
"sys.argv" is accessed. I can run 'python -c "import sys sys.argv", I
get an error message

-Tiro




More information about the Python-list mailing list