On Thu, Jul 22, 2010 at 11:25 AM, Eli Bendersky <eli...@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.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to