Can Python do this?

Robert Oschler Oschler at earthlink.net
Mon Mar 4 12:51:13 EST 2002


Hello, Python newbie here.

Let's say I'd like to build a method name into a string variable (e.g.
"FuncCall" + "1" to attempt to call "FuncCall1").  Can I then call that
method by somehow having the interpreter evaluate the string variable into a
call to the desired method? (I know this is usually done in a language like
Prolog or Lisp but I'm hoping Python can do it too.)

If so, can you point me to a good article or example of such that would show
me the relevant Python syntax.

Thanks.






More information about the Python-list mailing list