➜

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.

作者 zach.ware
收信人 docs@python, georg.brandl, jgehrcke, krivushinme, pitrou, vstinner, zach.ware
日期 2015-02-10.20:59:26
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1423601967.13.0.801675322941.issue23427@psf.upfronthosting.co.za>
In-reply-to
内容
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.)
历史
日期 用户 动作 参数
2015-02-10 20:59:27zach.ware修改recipients: + zach.ware, georg.brandl, pitrou, vstinner, jgehrcke, docs@python, krivushinme
2015-02-10 20:59:27zach.ware修改messageid: <1423601967.13.0.801675322941.issue23427@psf.upfronthosting.co.za>
2015-02-10 20:59:27zach.ware链接issue23427 messages
2015-02-10 20:59:26zach.ware创建