Skip to content

Instantly share code, notes, and snippets.

@slawosz
Created March 19, 2014 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slawosz/9641396 to your computer and use it in GitHub Desktop.
Save slawosz/9641396 to your computer and use it in GitHub Desktop.
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