解決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"}],
)
相關文章
Pyinstaller+Pipenv打包Python文件的實現(xiàn)示例
相信大家都試過將Python文件進行打包,本文主要介紹了Pyinstaller+Pipenv打包Python文件,文中通過示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2022-03-03
PyTorch中tensor.backward()函數(shù)的詳細介紹及功能實現(xiàn)
backward()?函數(shù)是PyTorch框架中自動求梯度功能的一部分,它負責執(zhí)行反向傳播算法以計算模型參數(shù)的梯度,這篇文章主要介紹了PyTorch中tensor.backward()函數(shù)的詳細介紹,需要的朋友可以參考下2024-02-02
淺談Pytorch torch.optim優(yōu)化器個性化的使用
今天小編就為大家分享一篇淺談Pytorch torch.optim優(yōu)化器個性化的使用,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-02-02

