script question

Chris Rebert clp2 at rebertia.com
Fri Apr 17 09:09:37 CEST 2009


On Fri, Apr 17, 2009 at 12:00 AM, Stefano <stefano at vulcanos.it> 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):
>   myscript.func??
    getattr(myscript, "func"+str(n))() #disregarding zero-padding

Cheers,
Chris
-- 
I have a blog:
http://blog.rebertia.com



More information about the Python-list mailing list