Re: Load three different modules which have the same name

2007-03-20 Thread Alex Martelli
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

Re: Load three different modules which have the same name

2007-03-20 Thread abcd
thanks for the help. -- http://mail.python.org/mailman/listinfo/python-list

Re: Load three different modules which have the same name

2007-03-20 Thread Ben Finney
"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

Re: Load three different modules which have the same name

2007-03-20 Thread Steve Holden
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

Re: Load three different modules which have the same name

2007-03-20 Thread Gabriel Genellina
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

Re: Load three different modules which have the same name

2007-03-20 Thread abcd
> 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

Re: Load three different modules which have the same name

2007-03-19 Thread Steve Holden
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

Re: Load three different modules which have the same name

2007-03-19 Thread Carsten Haese
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

Re: Load three different modules which have the same name

2007-03-19 Thread abcd
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

Load three different modules which have the same name

2007-03-19 Thread abcd
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