![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveRe: Building a function call?
From: Duncan Booth <duncan.booth@invalid.invalid>
Date: Wed Jul 13 2005 - 14:56:26 CEST
Francois De Serres wrote:
aString = "dothat"
If aString is the name of a function in the current module:
globals()[aString](*aTuple)
If aString is a function in another module:
import otherModule
and if you don't know the name of the module in advance:
otherModule = __import__(nameOfOtherModule)
Better still, collect all the functions you expect to be callable in this
|