Python win32 service

孤街浪徒 提交于 2019-12-01 21:31:41

Replace your: setup(console=[{"script":'Service.py'}] with setup(service=[{"script":'Service.py'}]. Instead of console use service.

try this setup:

py2exe_options = {"includes": ['decimal'],'bundle_files': 1}
setup(
    service=[{'modules':'Service.py','cmdline_style':'pywin32','description':'your service description'}],
    options={'py2exe':py2exe_options},
    zipfile=None)

A quick google came up with this: http://islascruz.org/html/index.php?gadget=StaticPage&action=Page&id=6

It has Italian comments, but I can help you translate some stuff if you don't know Italian.

To truly debug your problem, I guess we will need to see your setup.py distutils script...

You probably might be missing the right PATH for finding all the DLLs required by the service. Usually the service gets installed as a 'LocalSystem' service so you need to add the PATH to the System (and not to User).

Try adding c:\python27 (or whatever the path to your python dlls is) to the SYSTEM PATH, restart the computer and check if it now starts fine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!