Load three different modules which have the same name

abcd codecraig at gmail.com
Mon Mar 19 14:42:44 EDT 2007


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.remove(b)
    sys.path.append(g)
    reload(Person)
    gamma = Person.Person()

thanks




More information about the Python-list mailing list