script question

Peter Otten __peter__ at web.de
Fri Apr 17 09:08:57 CEST 2009


Stefano wrote:

> I have a script like this
> 
> myscript.py
> 
>     def func01()
>     def func02()
>     def func03()
>     ....
>     def funcnn()
> 
> How can i execute my func in the code ?
> 
> import myscript
> for i in range(1,n):
      getattr(myscript, "func%02d" % i)()




More information about the Python-list mailing list