[Python-ideas] Replacing the if __name__ == "__main__" idiom (was Re: making a module callable)
Gregory P. Smith
greg at krypto.org
Sun Nov 24 07:25:40 CET 2013
On Sat, Nov 23, 2013 at 7:35 PM, Greg Ewing <greg.ewing at canterbury.ac.nz>wrote:
> Haoyi Li wrote:
>
>> Import hooks don't work with __main__ =( I spent a while trying to get it
>> to work when working on MacroPy, to no avail.
>>
>
> It's hard to see how they could. How would you *install*
> an import hook before __main__ got imported?
*Don't do this*... but you can abuse sitecustomize:
http://docs.python.org/3.4/library/site.html
-gps
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131123/110d0f08/attachment.html>
More information about the Python-ideas
mailing list