A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2010-March/720352.html below:

conditional import into global namespace

conditional import into global namespace conditional import into global namespacemk mrkafk at gmail.com
Tue Mar 2 15:41:44 EST 2010
Jerry Hill wrote:
> Just import subprocess at the top of your module.  If subprocess
> hasn't been imported yet, it will be imported when your module is
> loaded.  If it's already been imported, your module will use the
> cached version that's already been imported.
> 
> In other words, it sounds like Python already does what you want.  You
> don't need to do anything special.

Oh, thanks!

Hmm it's different than dealing with packages I guess -- IIRC, in 
packages only code in package's __init__.py was executed?

Regards,
mk



More information about the Python-list mailing list

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