Created
July 26, 2013 11:33
-
-
Save frutik/6088194 to your computer and use it in GitHub Desktop.
This file contains 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
frutik@Andrews-Mac-mini ~/Downloads$ cat a.py | |
class A(object): | |
def a(self): | |
print 'I am a' | |
frutik@Andrews-Mac-mini ~/Downloads$ cat b.py | |
class A(object): | |
def a(self): | |
print 'not a' | |
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53) | |
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> a = __import__('a', globals(), locals(), [], -1) | |
>>> a.A().a() | |
I am a | |
>>> a = __import__('b', globals(), locals(), [], -1) | |
>>> a.A().a() | |
I am not a actualy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment