Gabriel Genellina <[EMAIL PROTECTED]> wrote:
...
> > example i could load Person from Person (in alpha) as, "Person_Alpha"
> > or something like that in sys.modules? not sure how I might do that.
>
> Use the "as" clause when importing; it's almost the same phrase you wrote
> above:
> from alp
thanks for the help.
--
http://mail.python.org/mailman/listinfo/python-list
"abcd" <[EMAIL PROTECTED]> writes:
> nevermind this took care of it:
>
> import sys
>
> def tryAllThree():
> a = "c:\\alpha"
> b = "c:\\beta"
> g = "c:\\gamma"
>
> sys.path.append(a)
> import Person
> alpha = Person.Person()
To avoid this confusion, follow PEP 8
http://www
abcd wrote:
>> Blerch! Why not just call the modules by the right names in the first
>> place? Then each will have its own sys.modules entry for a start ...
>>
>> regards
>> Steve
>
> what do i need to do? also, is there a way I can load each one as I
> have but each one have its own unique ent
En Tue, 20 Mar 2007 07:40:53 -0300, abcd <[EMAIL PROTECTED]> escribió:
>> Blerch! Why not just call the modules by the right names in the first
>> place? Then each will have its own sys.modules entry for a start ...
>
> what do i need to do? also, is there a way I can load each one as I
> have bu
> Blerch! Why not just call the modules by the right names in the first
> place? Then each will have its own sys.modules entry for a start ...
>
> regards
> Steve
what do i need to do? also, is there a way I can load each one as I
have but each one have its own unique entry in sys.modules? For
abcd wrote:
> nevermind this took care of it:
>
> import sys
>
> def tryAllThree():
> a = "c:\\alpha"
> b = "c:\\beta"
> g = "c:\\gamma"
>
> sys.path.append(a)
> import Person
> alpha = Person.Person()
>
> sys.path.remove(a)
> sys.path.append(b)
> reload(Pers
On Mon, 2007-03-19 at 11:42 -0700, abcd wrote:
> nevermind this took care of it:
>
> import sys
>
> def tryAllThree():
> a = "c:\\alpha"
> b = "c:\\beta"
> g = "c:\\gamma"
>
> sys.path.append(a)
> import Person
> alpha = Person.Person()
>
> sys.path.remove(a)
> s
nevermind this took care of it:
import sys
def tryAllThree():
a = "c:\\alpha"
b = "c:\\beta"
g = "c:\\gamma"
sys.path.append(a)
import Person
alpha = Person.Person()
sys.path.remove(a)
sys.path.append(b)
reload(Person)
beta = Person.Person()
sys.path
I have the following directory structure setup...
c:\alpha\Person.py
--
class Person(IPerson):
def __init__(self):
print "Alpha person here"
c:\beta\Person.py
--
class Person(IPerson):
def __init__(self):
print "Beta person here"
c:\gamma\P
10 matches
Mail list logo