Sunday, November 21, 2010

Running Python scripts from Python

During my start up days of learning Python, i had the necessity to shuttle between python prompt and command script (terminal), because of the reason i did not know how to run python files(.py files) from Python.


this is how to do it...
import os
os.system('python somefile.py')
#simple...

No comments:

Post a Comment