解决python写的windows服务不能启动的问题
时间:2023-01-21 04:10:38
报“服务没有及时响应或控制请求”的错误,改用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"}],
)
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python3.5集合及其常见运算实例详解
详解Python中字典的增删改查
![](https://img.aspxhome.com/file/2023/5/131025_0s.jpg)
JavaScript中遍历对象的property的3种方法介绍
![](https://img.aspxhome.com/file/2023/8/122788_0s.png)
PyQt5显示GIF图片的方法
![](https://img.aspxhome.com/file/2023/6/95676_0s.gif)
Python中six模块基础用法
SQLserver 2000中出现“指定的服务并未以已安装的服务存在 解决方案
python使用xlrd实现检索excel中某列含有指定字符串记录的方法
本机安装PaddlePaddle安装指南及步骤详解
![](https://img.aspxhome.com/file/2023/3/70773_0s.jpg)
python轻松实现代码编码格式转换
极简网页设计视觉呈现技巧
![](https://img.aspxhome.com/file/UploadPic/20104/20/01-42s.jpg)
Python数据结构与算法中的栈详解(3)
![](https://img.aspxhome.com/file/2023/4/67384_0s.png)
vue实现滑动验证条
![](https://img.aspxhome.com/file/2023/5/130175_0s.jpg)
详细介绍Python中的set集合
一些Python中的二维数组的操作方法
python爬虫爬取网页数据并解析数据
![](https://img.aspxhome.com/file/2023/8/76808_0s.png)
vue表单数据交互提交演示教程
python多进程下实现日志记录按时间分割
MySQL使用变量实现各种排序
Sql学习第三天——SQL 关于CTE(公用表达式)的递归查询使用
![](https://img.aspxhome.com/file/2023/0/84340_0s.png)
一文总结MySQL中数学函数有哪些
![](https://img.aspxhome.com/file/2023/1/97431_0s.png)