>>>>> "Stefano" <stef...@vulcanos.it> (S) wrote:
>S> I have a script like this >S> myscript.py >S> def func01() >S> def func02() >S> def func03() >S> .... >S> def funcnn() >S> How can i execute my func in the code ? >S> import myscript >S> for i in range(1,n): >S> myscript.func?? Others have suggested getattr. I think a cleaner (more pythonic) way would be: funclist = [func01, func02, func03, ... ] for i in range(1,n): funclist[i]() Or myscript.funclist[i]() from another module. -- Piet van Oostrum <p...@cs.uu.nl> URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4] Private email: p...@vanoostrum.org -- http://mail.python.org/mailman/listinfo/python-list