解决python写的windows服务不能启动的问题
报“服务没有及时响应或控制请求”的错误,改用pyinstaller生成也是不行;查资料后修改setup.py如下即可,服务名、脚本名请自行替换:
代码如下:
#!/usr/bin/python #-*-coding:cp936-*- from distutils.core import setup import py2exe class 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"}], )
相关推荐
EdwardSiCong 2020-11-23
yungpheng 2020-10-19
jipengx 2020-11-12
橄榄 2020-11-03
lyqdanang 2020-11-02
wservices 2020-10-30
onepiecedn 2020-10-29
数据人 2020-10-26
dfphoto 2020-10-16
hackerlpy 2020-09-07
tianyayi 2020-08-16
Dullonjiang 2020-08-15
fengling 2020-08-15
wordmhg 2020-08-06
guotiaotiao 2020-08-06
zhangsyi 2020-07-28
千锋 2020-07-27
ahnjwj 2020-07-28