Skip to content

Instantly share code, notes, and snippets.

@aoisensi
Created November 29, 2012 05:32
Show Gist options
  • Save aoisensi/4167010 to your computer and use it in GitHub Desktop.
Save aoisensi/4167010 to your computer and use it in GitHub Desktop.
#test.py
class C(object):
def foo(self):
return "bar"
load_class = C
#main.py
class Start(object):
def go(self):
execfile("test.py")
c = load_class
print c.foo()
s = Start()
s.go()
#main2.py
#これならいける
execfile("test.py")
c = load_class
print c.foo()
#test.py
class C(object):
def foo(self):
return "bar"
load_class = C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment