The '-c' CLI option removes just the command str.

Simon Forman sforman at hushmail.com
Tue May 5 17:23:09 EDT 2020


Is this anything?  When you run a python command from the shell to just print the command line args you get this:

    $ python -c "import sys; print(sys.argv)"
    ['-c']

But I would expect one of these:

Either the '-c' option consumes both args:

    $ python -c "import sys; print(sys.argv)"
    []

Or it leaves them both in:

    $ python -c "import sys; print(sys.argv)"
    ['-c', 'import sys; print(sys.argv)']


What do you think?

Warm regards,
~Simon



More information about the Python-list mailing list