Hi,
 
I'm trying to execute a python script as a windows service.
I found some information at:
http://agiletesting.blogspot.com/2005/09/running-python-script-as-windows.html
 
The steps I've taken are the following:
 
1. Downloaded Windows Resource Kits
2. Executed instsrv.exe nameOfService srvany.exe
3. In registry added a key Parameters in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nameOfService entry
4. Under Parameters added three string values:
    4.1: Application                REG_SZ                    C:\Python25\pythonw.exe
    4.2: AppDirectory            REG_SZ                    C:\Python25
    4.3: AppParameters         REG_SZ                    C:\Documents and Settings\torerik\My Documents\Apps\SARImageProcessing\time.py
5. Started nameOfService in Control Panel --> Adminstrative Tools --> Services
 
This is not working however as the python script (time.py) looks like this:
 
import time
 
i = 0
while True:
    f = open(r'C:\testService.txt', 'wb')
    f.write(str(i))
    f.close()
    i += 1
    time.sleep(1)
 
and no file named testService.txt is created.
I've tried executing the script normally, and it works like a charm...
Any ideas?
 
regards
 
 
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to