[mod_python] PythonImport: Can someone please draw a diagramforthis idiot?

Lee Brown administrator at leebrown.org
Wed Sep 14 09:13:52 EDT 2005


Greetings!

It was not my intention to be condescending; rather, I was attempting to be
in good humor and I apologize for the offense.  In fact, I had the exact
same problem with imports and namespaces only a few months ago.

If your object is still not accessible in the correct namespace, then the
next thing to check is to see if your code is executing under the
interpreter name that you think it should.    The example code that Jorey
Bump published will help you determine this.

I agree with you that doing an import once at server startup rather than at
each request seems like a cleaner way to go.  The only drawback is that if
you change the code in the imported module you'll have to re-start the
server but this usually isn't a problem for many applications.

Best Regards,
Lee E. Brown
(administrator at leebrown.org)

-----Original Message-----
From: mod_python-bounces at modpython.org
[mailto:mod_python-bounces at modpython.org] On Behalf Of
jamestmcneill-python at yahoo.co.uk
Sent: Wednesday, September 14, 2005 3:19 AM
To: mod_python at modpython.org
Subject: RE: [mod_python] PythonImport: Can someone please draw a
diagramforthis idiot?

I suppose I asked for an RTFM. Gosh it would be great to be as clever as
you. I'm in awe. No really, I mean how could I make such a stupid mistake?
Even the crassest beginner knows better than that.

I'll take the hint and unsubscribe, and leave this list to you clever
people. I hope you're happy together.

Cheers
Jim

--- Lee Brown <administrator at leebrown.org> wrote:

> No, I won't draw you a picture, but I'll give you a push in the right
> direction:  If you were to use
> 
> 	import mpglobals.py
> 
> In any other ordinary python program, in what namespace would you 
> expect to find the contents of mpglobals?
> 
> 
> Best Regards,
> Lee E. Brown
> (administrator at leebrown.org)

++++++++++++++++++++++++++++++++++++++++++++++++++
+   If you've got a good excuse - don't use it   +
++++++++++++++++++++++++++++++++++++++++++++++++++)

_______________________________________________
Mod_python mailing list
Mod_python at modpython.org
http://mailman.modpython.org/mailman/listinfo/mod_python



More information about the Mod_python mailing list