[Python-Dev] PEP397 no command line options to python?

Vinay Sajip vinay_sajip at yahoo.co.uk
Wed Oct 19 14:40:30 CEST 2011


Sam Partington <sam.partington <at> gmail.com> writes:

> Ok ok, I give up.  Apparently I am the only one who wants to be able
> to run different versions of python based on the shebang line AND add
> occasional arguments to the python command line.

It sounds as if adding arguments to the shebang line will work for all cases
other than the invoke-from-editor case. (Even if you need to change thousands of
shebang lines, you might be able to automate this with Python, so perhaps it's
not as bad as it sounds.)

For the invoke-from-editor case, that's most useful when you have a reasonably
long edit-run-edit-run-... session for the script(s) being edited. If that's the
case, just append -u to the shebang line at the beginning of your session, and
remove it at the end, and keep using "py" as your editor's Python; won't that do
the trick?

Regards,

Vinay Sajip





More information about the Python-Dev mailing list