call one python script from within another

hokiegal99 hokiegal99 at hotmail.com
Sat Jul 12 12:14:11 EDT 2003


Irmen de Jong <irmen at -NOSPAM-REMOVETHIS-xs4all.nl> wrote in message news:<3f0f40b9$0$49103$e4fe514c at news.xs4all.nl>...
> Tubby Tudor wrote:
> > What is the best way to call one python script from within another 
> > python script? For example:
> > 
> > one.py finishes succesfully and calls two.py which finishes OK and then 
> > calls three.py
> > 
> > Thanks guys!
> > 
> 
> one.py:
> ---------------
> 
> import two
> import three
> 
> 
> def main():
>      ....  body of your code here ....
> 
> 
> main()		# run code in one
> two.main()	# run code in two
> three.main()	# run code in three
> ------------------
> 
> Will this do?


Yes, this works. Thanks for the tip!




More information about the Python-list mailing list