A
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\Person.py
------------------
class Person(IPerson):
def __init__(self):
print "Gamma person here"
c:\ok\playground.py
-------------------
def tryAllThree():
a = "c:\\alpha"
b = "c:\\beta"
g = "c:\\gamma"
sys.path.append(a)
from Person import Person
alpha = Person()
sys.path.remove(a)
sys.path.append(b)
from Person import Person
beta = Person()
sys.path.remove(b)
sys.path.append(g)
from Person import Person
gamma = Person()
Notice that my three different projects (alpha, beta, gamma) have a
Person.py which contains a Person class.
When I execute the following (on windows):
c:\ok> python
I see...
Alpha person here
Alpha person here
Alpha person here
What I want to see is
Alpha person here
Beta person here
Gamma person here
.....how can I get this to work?
Thanks
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\Person.py
------------------
class Person(IPerson):
def __init__(self):
print "Gamma person here"
c:\ok\playground.py
-------------------
def tryAllThree():
a = "c:\\alpha"
b = "c:\\beta"
g = "c:\\gamma"
sys.path.append(a)
from Person import Person
alpha = Person()
sys.path.remove(a)
sys.path.append(b)
from Person import Person
beta = Person()
sys.path.remove(b)
sys.path.append(g)
from Person import Person
gamma = Person()
Notice that my three different projects (alpha, beta, gamma) have a
Person.py which contains a Person class.
When I execute the following (on windows):
c:\ok> python
I see...
Alpha person here
Alpha person here
Alpha person here
What I want to see is
Alpha person here
Beta person here
Gamma person here
.....how can I get this to work?
Thanks