import sys
class RemoteControl(object):
def __init__(self, func, *args):
self.func = func
self.args = args
def callFunc(self):
apply(self.func, self.args)
def test(*args):
print "this is test"
print "args: %s" % args
dictFunc = {"test":test}
if __name__=="__main__":
funcName = sys.argv[1]
print funcName
args = tuple(sys.argv[2:])
print args
funcName = "test"
RemoteControl(dictFunc[funcName], args).callFunc()