[Python-Dev] Running a module as a script (original) (raw)

Nick Coghlan ncoghlan at email.com
Thu Sep 30 12:11:06 CEST 2004


Patch # 1035498 attempts to implement the semantics suggested by Ilya and Anthony and co.

"python -m module"

Means:

The allowed modules are those whose associated source file meet the normal rules for a command line script. I believe that means .py and .pyc files only (e.g. "python -m profile" works, but "python -m hotshot" does not).

Special import hooks (such as zipimport) almost certainly won't work (since I don't believe they work with the current command line script mechanism).

Cheers, Nick.

-- Nick Coghlan Brisbane, Australia



More information about the Python-Dev mailing list