Hey guys....
I use Python 2.6.2. I recently created a program which accepts commands from my website, here's the code I used:
import urllib
import subprocess
import time
open_site=urllib.urlopen("http://www.sravan953.webs.com/command_python.htm")
read_site=open_site.read()
def run_program():
current=time.asctime()
print 'Runnning program'+' ['+current+']'
subprocess.call(read_site)
def check_argument():
current=time.asctime()
if read_site=='':
print 'No command given'+' ['+current+']'
timer()
else:
print 'Command found...'+' ['+current+']'
run_program()
def timer():
current=time.asctime()
print 'Checking for commands...'+' ['+current+']'
time.sleep(2)
check_argument()
timer()
But when I run it I get an error:
Traceback (most recent call last):
File "C:\Documents and Settings\Sravan\My Documents\Sravan\PYTHON\Accepshun.py", line 28, in <module>
timer()
File "C:\Documents and Settings\Sravan\My Documents\Sravan\PYTHON\Accepshun.py", line 26, in timer
check_argument()
File "C:\Documents and Settings\Sravan\My Documents\Sravan\PYTHON\Accepshun.py", line 20, in check_argument
run_program()
File "C:\Documents and Settings\Sravan\My Documents\Sravan\PYTHON\Accepshun.py", line 11, in run_program
subprocess.call("C:\Program Files\Mozilla Firefox 3.1 Beta 3\firefox.exe")
File "C:\Python26\lib\subprocess.py", line 444, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\Python26\lib\subprocess.py", line 595, in __init__
errread, errwrite)
File "C:\Python26\lib\subprocess.py", line 804, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
I only recently uninstalled Python 2.6.2 and re-installed it again, and then installed py2exe....it used to work fine before I uninstalled it, is there anything else I have to install?
Thanks for the help guys...