calling another python file within python

Rene Pijlman at
Tue Mar 14 17:39:25 CET 2006

>import os
>import urllib
>os.system("python ibm > text1.txt")

Check the return value of os.system.

>note: currently the text1.txt outputted is just blank, however if i run 
>the command normally as 'python ibm' in the command line, it 
>works correctly and gives me the price of ibm.

Same PATH, PYTHONPATH, current working directory, user,... ?

René Pijlman

More information about the Python-list mailing list