[python-win32] How to invoke Python program from Windows service?
Funke, Matt
Matt.funke at vishaypg.com
Fri Jun 22 13:19:21 CEST 2012
> 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 process so you can get diagnostics
> from the output - just telling us it is "unsuccessful" doesn't help us
> tell you what problem you have.
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 when I ran it using CreateProcess (and ProcessStartInfo), I didn't see it execute (since it would have created a file in its directory).
However, your answer that I can write it directly with pywin32 intrigues me, especially since I'd rather develop in Python anyway. I'll go see what's involved in doing that. Thanks for the pointer!
More information about the python-win32
mailing list