报“服务没有及时响应或控制请求”的错误,改用pyinstaller生成也是不行;查资料后修改setup.py如下即可,服务名、脚本名请自行替换:
#!/usr/bin/python
#-*-coding:cp936-*-
from distutils.core import setup
import py2execlass Target:
def __init__(self, **kw):
self.__dict__.update(kw)
# for the versioninfo resources
self.version = "1.1.8"
self.company_name = "Yovole Shanghai Co. Ltd."
self.copyright = "Copyright (c) 2013 Founder Software (Shanghai) Co., Ltd. "
self.name = "Guest Agent"
myservice = Target(
description = 'Yovole Cloud Desktop Guest Agent',
modules = ['service'],
cmdline_style='pywin32'
#icon_resources=[(1, "cartrigde.ico")]
)options = {"py2exe":
{ "compressed": 1,
"bundle_files": 1
}
} setup(
service=[myservice],
options = options,
zipfile = None,
windows=[{"script": "service.py"}],
)
到此这篇关于解决python写的windows服务不能启动的问题就介绍到这了。与其担心未来,不如现在好好努力。人生没有彩排,每个人有每个人的。不是所有的人都会完美。岁月如歌,人生如潮。有一颗随缘心,你会更洒脱;有一颗平常心,你会更从容;有一颗慈悲心,你会更积善;有一颗感恩心,你会更幸福;有一颗因果心,你会更明理。更多相关解决python写的windows服务不能启动的问题内容请查看相关栏目,小编编辑不易,再次感谢大家的支持!