script question

alex23 wuwei23 at gmail.com
Fri Apr 17 09:10:30 CEST 2009


On Apr 17, 5:00 pm, "Stefano" <stef... at vulcanos.it> wrote:
> How can i execute my func in the code ?
>
> import myscript
> for i in range(1,n):
>     myscript.func??


for i in range(1,n):
    getattr(myscript, 'func%d' % i)()



More information about the Python-list mailing list