Note you can write the service directly in Python using pywin32. If
you want to write the service using some other technology and just
spawn Python, then I'd suggest using just CreateProcess. But with
both CreateProcess and ProcessStartInfo, you need a way to
redirect output from the Python
Matt,
Yeah, that was exactly my problem; I had no way to diagnose what was going
on, and needed a springboard to tell me what I needed to know in order to
figure out what was happening (or not). I could verify that the script
*worked*, since I could run it from a DOS prompt without
Yeah, that was exactly my problem; I had no way to diagnose what was
going on, and needed a springboard to tell me what I needed to know
in order to figure out what was happening (or not). I could verify
that the script *worked*, since I could run it from a DOS prompt
without errors. But
Services are pretty tricky - you might be better off arranging for the
Python script to write sys.stderr somewhere useful and seeing what the
traceback says - you'll almost certainly strike the same problem after
you get a pywin32 based one close to working.
Mark
On 22/06/2012 9:19 PM,
From my experiences with Python windows services some things to lookout for:
- the working directory of the service is usually where the service control
programm resides; especially NOT your Python directory
- the path is usually the system path. It is not uncommon that Python resides
in
For reference, this is the kind of pattern I use when writing Windows
Services in Python:
This is incredibly useful. Thank you.
Matt Funke
Programmer/Analyst
Vishay Precision Group, Inc.
951 Wendell Blvd
Wendell, NC 27591 USA
Office: 919-374-5553
Mobile: 919-628-9261
Fax: 919-374-5248
For reference, this is the kind of pattern I use when writing Windows
Services in Python:
This is incredibly useful. Thank you.
+1
Malcolm
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32
I'm relatively new to the world of Windows programming, but I have a Python
program I'd like to run every once in a while from a Windows service. I've
gotten the service itself to run as it's supposed to, but attempts to run the
program with a DOS command (using ProcessStartInfo) are
On 22/06/2012 6:25 AM, Funke, Matt wrote:
I’m relatively new to the world of Windows programming, but I have a
Python program I’d like to run every once in a while from a Windows
service. I’ve gotten the service itself to run as it’s supposed to, but
attempts to run the program with a DOS