Created
March 19, 2014 13:16
-
-
Save slawosz/9641396 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
import sys | |
class MyClass: | |
"""A simple example class""" | |
def foo(self): | |
return 'foo meth' | |
def bar(self): | |
return 'bar meth' | |
obj = MyClass() | |
print eval("obj." + sys.argv[1] + "()") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment