Building a Windows NT service with py2exe

Mark Hammond mhammond at skippinet.com.au
Wed Mar 26 16:18:28 EST 2003


Adam Albrechtas wrote:
> I have coded a Windows NT service in Python 2.2.  The service works
> when running as a python script.  I can use py2exe to roll it into an
> .exe without specifying that it is a service (which means that the
> .exe ultimately does not work but at least the process completes). 
> When I use py2exe while specifying a service build I receive the
> following:

...
>   File "<string>", line 45
>     win32serviceutil.HandleCommandLine(NTAdminService)
>                                                     ^
> SyntaxError: invalid syntax

My guess is that your script file simply does not have a \n at the end 
of the file.  Python itself doesn't care about this, but exec does!

Mark.





More information about the Python-list mailing list