List Info

Thread: Python script as a windows service




Python script as a windows service
user name
2006-11-02 09:27:43
Hi,
 
I'm trying to execute a python script as a windows service.
I found some information at:
 
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_MACHINESYSTEMCurrentControlSetServicesnameOfService entry
4. Under Parameters added three string values:
    4.1: Application         ;       REG_SZ        ;           ; C:Python25pythonw.exe
    4.2: AppDirectory       ;     REG_SZ        ;           ; C:Python25
    4.3: AppParameters     ;    REG_SZ        ;           ; C:Documents and SettingstorerikMy DocumentsAppsSARImageProcessingtime.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
 
 
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )