python -c cmd bug?

erik_w erik.wilsher at iname.com
Wed Mar 13 02:54:18 EST 2002


When I do 
>python -c "import sys;print sys.argv"
['-c']

(Python 2.1.2 on NT4)

Is this the right behaviour?  I would expect that the -c was an option
to the python interpreter, not to my script.

If I do 
>python -O -c "import sys;print sys.argv"
['-c']

the -O switch is not reflected in sys.argv


    BR
    EW



More information about the Python-list mailing list