Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #53546

Re: problem of double import in python

From alex23 <wuwei23@gmail.com>
Newsgroups comp.lang.python
Subject Re: problem of double import in python
Date 2013-09-03 11:07 +1000
Organization A noiseless patient Spider
Message-ID <l03cpb$49r$1@dont-email.me> (permalink)
References <mailman.526.1378169302.19984.python-list@python.org>

Show all headers | View raw


On 3/09/2013 10:48 AM, Mohsen Pahlevanzadeh wrote:
> Unfortunately, i prevent to same error, double import to python, but i
> don't know how to solve, Even i don't know policy of python programmers.

You don't need to do anything, Python takes care of this for you.

During execution, a module is only loaded the first time it is imported. 
Every following import will notice that it has already been loaded and 
return a reference to the module instead.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

problem of double import in python Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> - 2013-09-03 05:18 +0430
  Re: problem of double import in python alex23 <wuwei23@gmail.com> - 2013-09-03 11:07 +1000

csiph-web