Re: Namespace question
- From: Chris M <chris.monsanto@xxxxxxxxx>
- Date: Wed, 31 Oct 2007 20:12:24 -0000
On Oct 31, 10:06 am, Frank Aune <Frank.A...@xxxxxxxxxxxx> wrote:
Hello,
Is it possible writing custom modules named the same as modules in the
standard library, which in turn use the same module from the standard
library?
Say I want my application to have a random.py module, which in turn must
import the standard library random.py module also, to get hold of the randint
function for example.
My attempts so far only causes my random.py to import itself instead of the
standard library random.py
Receipt for disaster? :)
Regards,
Frank
Read up on absolute imports (In Python 2.5, from __future__ import
absolute_imports) is required. You can load your random.py with
import .random, which can import the standard lib with import random.
.
- References:
- Namespace question
- From: Frank Aune
- Namespace question
- Prev by Date: 3 number and dot..
- Next by Date: Re: 3 number and dot..
- Previous by thread: Namespace question
- Next by thread: Fwd: Namespace question
- Index(es):