This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zach.ware
Recipients docs@python, georg.brandl, jgehrcke, krivushinme, pitrou, vstinner, zach.ware
Date 2015-02-10.20:59:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1423601967.13.0.801675322941.issue23427@psf.upfronthosting.co.za>
In-reply-to
Content
Rather than add a variable to sys that will be empty 99% of the time, I think I'd rather stick a '__command__' constant in the __main__ module namespace when running with '-c' (think of '__file__').  You could then get at it elsewhere with 'from __main__ import __command__' (probably wrapped in a try/except ImportError, since it will usually not exist).

This should probably be discussed on python-ideas.

(Removing all versions but 3.5, as this is a feature request.)
History
Date User Action Args
2015-02-10 20:59:27zach.waresetrecipients: + zach.ware, georg.brandl, pitrou, vstinner, jgehrcke, docs@python, krivushinme
2015-02-10 20:59:27zach.waresetmessageid: <1423601967.13.0.801675322941.issue23427@psf.upfronthosting.co.za>
2015-02-10 20:59:27zach.warelinkissue23427 messages
2015-02-10 20:59:26zach.warecreate