On Fri, Jul 23, 2010 at 2:25 AM, Alexander Belopolsky <alexander.belopolsky at gmail.com> wrote: > 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. If __main__.__package__ is set to anything other than None, odds are fairly good that runpy did the import. If it's set to a non-empty string, you definitely *shouldn't* be invoking the relevant main script by filename. Sounds like one for the tracker. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
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