Created
December 21, 2012 13:41
-
-
Save raelmax/4352914 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
>>> class XYZ(object): | |
... def __init__(self): | |
... print 'Output!' | |
... | |
>>> kls = 'XYZ' | |
>>> inst = locals()[kls] | |
>>> inst | |
<class '__main__.XYZ'> | |
>>> inst() | |
Output! | |
<__main__.XYZ object at 0x9086e4c> | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment