In article <78388a7a-b148-499a-8894-34e55721e...@k19g2000pro.googlegroups.com>,
lordofcode wrote:
>
>Thanks you all for your replies ,cleared quiet a few doubts about
>importing modules and namespace references .
>Currently am going with static importing of all modules. But it may
>not be efficie
On 12/24/2009 11:51 PM, Jean-Michel Pichavant wrote:
But what he *can* do is to learn how importing works. I'm not sure
it's terribly helpful to tell somebody all the things they can't do
instead of what they can.
Hacking python imports would not be in the top of the list of things I
would tea
Steven D'Aprano wrote:
On Wed, 23 Dec 2009 15:31:53 +0100, Jean-Michel Pichavant wrote:
Steven D'Aprano wrote:
On Wed, 23 Dec 2009 13:37:06 +0100, Jean-Michel Pichavant wrote:
But believe me, you don't want to mess up with the python import
mechanism.
Unle
lordofcode wrote:
> Hi All
>
> Not an expert in Python, so sorry if this sounds like a silly
> question.
> I went through other few threads in the mailing list but they are not
> helping me much.
> I have run into a problem related to dynamically loading and unloading
> a module.
> I need to dynam
On Wed, 23 Dec 2009 15:18:10 -0800, Carl Banks wrote:
>> > # will unload mod1 assuming mod1 was the only reference to that
>> > module.
>>
>> Which is highly unlikely. Any classes or functions from the module will
>> keep the module alive.
>
> Actually, they won't. Neither classes nor functions
Hi All,
Thanks you all for your replies ,cleared quiet a few doubts about
importing modules and namespace references .
Currently am going with static importing of all modules. But it may
not be efficient in future as the number of interchangeable modules
that I have to import may run in 30-40's.(B
On Dec 23, 7:40 am, Steven D'Aprano wrote:
> On Wed, 23 Dec 2009 13:37:06 +0100, Jean-Michel Pichavant wrote:
> > 3/ if you really need to unload the previous module, it's a little bit
> > tedious.
>
> > import mod1
> > del mod1
> > sys.modules['mod1'] = None
>
> Assigning sys.modules[name] to Non
On Wed, 23 Dec 2009 15:31:53 +0100, Jean-Michel Pichavant wrote:
> Steven D'Aprano wrote:
>> On Wed, 23 Dec 2009 13:37:06 +0100, Jean-Michel Pichavant wrote:
>>
>>
>>> But believe me, you don't want to mess up with the python import
>>> mechanism.
>>>
>>>
>> Unless you understand how it
Steven D'Aprano wrote:
On Wed, 23 Dec 2009 13:37:06 +0100, Jean-Michel Pichavant wrote:
3/ if you really need to unload the previous module, it's a little bit
tedious.
import mod1
del mod1
sys.modules['mod1'] = None
Assigning sys.modules[name] to None is not the same as deleting the
Steven D'Aprano wrote:
On Wed, 23 Dec 2009 13:37:06 +0100, Jean-Michel Pichavant wrote:
But believe me, you don't want to mess up with the python import
mechanism.
Unless you understand how it works.
Let me quote the OP: 'Not an expert in Python'
I was just answering the OP ques
On Wed, 23 Dec 2009 01:41:27 -0800, lordofcode wrote:
> I need to dynamically load a module and unload it and load another
> module.
Why bother unloading it? Unless you're programming for an embedded
device, it's highly unlikely that you're so strapped for memory that a
module will make any rea
On Wed, 23 Dec 2009 13:37:06 +0100, Jean-Michel Pichavant wrote:
> 3/ if you really need to unload the previous module, it's a little bit
> tedious.
>
> import mod1
> del mod1
> sys.modules['mod1'] = None
Assigning sys.modules[name] to None is not the same as deleting the
entry. None has speci
Jean-Michel Pichavant wrote:
lordofcode wrote:
Hi All
Not an expert in Python, so sorry if this sounds like a silly
question.
I went through other few threads in the mailing list but they are not
helping me much.
I have run into a problem related to dynamically loading and unloading
a module.
I
lordofcode wrote:
Hi All
Not an expert in Python, so sorry if this sounds like a silly
question.
I went through other few threads in the mailing list but they are not
helping me much.
I have run into a problem related to dynamically loading and unloading
a module.
I need to dynamically load a mo
On 12/23/2009 8:41 PM, lordofcode wrote:
Hi All
Not an expert in Python, so sorry if this sounds like a silly
question.
I went through other few threads in the mailing list but they are not
helping me much.
I have run into a problem related to dynamically loading and unloading
a module.
I need t
15 matches
Mail list logo