【问题标题】:how to create windows services by using python for openerp?如何使用 python for openerp 创建 Windows 服务?
【发布时间】:2013-06-28 09:13:42
【问题描述】:

我想为 open erp timesheet 创建一个 Windows 服务,它会在用户登录 windows 系统后自动启动。

如何使用支持open erp v7的python在windows中为上述场景创建服务?

【问题讨论】:

  • 搜索[python] [windows] +service时返回的184个结果都没有回答您的问题?
  • 我只是想知道如何在windows中创建新服务我提到了python,因为open erp开发是在python中。

标签: python windows-services openerp


【解决方案1】:

我从未尝试过,但您可以在 cmd/powershell 中使用“sc”命令为 openerp 创建 Windows 服务:

sc create openerpservice binpath= "C:\Program Files\OpenERP6.1\Server\service\OpenERPServerService.exe" \
type= own start= auto error= ignore DisplayName= OperERPNewService

您可以使用多个选项启动此服务

boot|system|auto|demand|disabled|delayed-auto(default = demand)

您也可以使用 python 代码启动/重新启动/停止此服务-

import win32serviceutil
serviceName = "openerpservice"
win32serviceutil.StartService(serviceName)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-02
    • 1970-01-01
    相关资源
    最近更新 更多