First if you know modulename and funcname you should be able to just call them, but assuming you may be reading them dynamically... > def something(modulename, funcName): > module = __import__(modulename) > func = module.funcName eval('func = '+modulename+'.'+funcname) return func foo = something('sys','exit') foo() # should exit! I think. Alan G