Created
November 29, 2012 05:32
-
-
Save aoisensi/4167010 to your computer and use it in GitHub Desktop.
謎
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#test.py | |
class C(object): | |
def foo(self): | |
return "bar" | |
load_class = C |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#main.py | |
class Start(object): | |
def go(self): | |
execfile("test.py") | |
c = load_class | |
print c.foo() | |
s = Start() | |
s.go() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#main2.py | |
#これならいける | |
execfile("test.py") | |
c = load_class | |
print c.foo() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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