calling another python file within python
Kevin
neurogasm at gmail.com
Tue Mar 14 11:09:49 EST 2006
i have a python file called pyq which outputs stock quotes, currently i
also have a html file that takes stock ticker inputs, i would like to
bridge the two by building another program that takes the html inputs
and uses them to call the pyq stock ticker program and then output them
into a text file...
any idea how to do this? my tentative code is:
#!/usr/bin/python
import os
import urllib
os.system("python pyq.py ibm > text1.txt")
note: currently the text1.txt outputted is just blank, however if i run
the command normally as 'python pyq.py ibm' in the command line, it
works correctly and gives me the price of ibm.
More information about the Python-list
mailing list