call one python script from within another

Irmen de Jong irmen at -NOSPAM-REMOVETHIS-xs4all.nl
Fri Jul 11 18:56:57 EDT 2003


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?

If not, you have to explain better what exactly you want to achieve...

--Irmen





More information about the Python-list mailing list