import foo vs. python -m foo
Hrvoje Niksic
hniksic at xemacs.org
Tue Oct 28 16:35:22 EDT 2008
More information about the Python-list mailing list
Tue Oct 28 16:35:22 EDT 2008
- Previous message (by thread): import foo vs. python -m foo
- Next message (by thread): import foo vs. python -m foo
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Simon Bierbaum <bierbaum at vierfalt.com> writes: > Hi all, > > what is the difference between saying "import foo" in an interactive > prompt and starting one using "python -m foo"? The -m switch is not > covered in the man page, is it even officially supported? My copy of the man page states: -m module-name Searches sys.path for the named module and runs the corresponding .py file as a script. > I'm asking because one of my modules fails on import in the second > version but succeeds in the first. It probably contains buggy code inside "if __name__ == '__main__': ...".
- Previous message (by thread): import foo vs. python -m foo
- Next message (by thread): import foo vs. python -m foo
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list