How to build a Windows service using win32?

Giles Brown giles_brown at hotmail.com
Thu Mar 8 04:55:55 EST 2007


On 7 Mar, 16:45, "Gregor Mosheh" <gre... at hostgis.com> wrote:
> Giles Brown wrote:
> > Yeah.  You've cleverly decided to simplify the "smallest
> > possible python service" by removing the
> > if __name__ == '__main__':
>
> Ha ha. :)
> Seriously, though, I removed that long after it was failing to work, and
> have since replaced it and it didn't affect a thing.

Thats "didn't affect a thing" in the sense of "it was still broken but
so it didn't *affect a thing* when something else about it was
broken"? Yeah?

For the record I'm pretty confident that the "if __name__ ==
'__main__':" is necessary to stop the module attempting to handle the
command line with the pythonservice.exe looks to import the service
class when you start the service via the SCM.

Anyway you've got it working now so thats the main thing.

Giles




More information about the Python-list mailing list