On Thu, Jul 22, 2010 at 11:25 AM, Eli Bendersky <eliben at gmail.com> wrote: >>> .. shouldn't the recommended >>> way to run a module as a script be python -m modname? As in >>> >>> $ python -m test.regrtest test_spam .. > So, how can a decision be reached on this issue? I'd like to fix the > relevant docs because currently there's a lot of confusion. I will fix > the :program: markup together with all the :option: and :cmdoption: > markup. Note also that argparse/optparse does not know about -m way either: $ python -m profile -h Usage: profile.py [-o output_file_path] [-s sort] scriptfile [arg] ... I am not sure if it is possible for argparse to distinguish between -m and file name invocations, so maybe it should always use python -m modname if sys.argv[0] ends with .py. Again, this is quite important if the module being run is inside a package.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4