PEP 338: Executing modules inside packages with '-m'

Fredrik Lundh fredrik at pythonware.com
Mon Dec 13 17:23:15 CET 2004


Nick Coghlan wrote:

>>     $ python -c "import foo.bar" arg
>
> This doesn't work. Any code protected by "if __name__ == '__main__':" won't run in this context 
> (since 'foo.bar' is being imported as a module, not run as a script).

I appreciate that you're taking the time to teach me about Python, but I can
assure you that it's not really needed.

as for the rest of your arguments, I have to assume that you were joking.  (or
that you have no experience whatsoever of distribution of Python programs in
Unix and Windows environments).

</F> 






More information about the Python-list mailing list