推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
littlepython
V2EX  ›  Python

windows server 怎么设置守护进程

  •  
  •   littlepython · Aug 15, 2019 · 5558 views
    This topic created in 2600 days ago, the information mentioned may be changed or developed.
    有几个 python 脚本在 windows server 下运行 ,有没有什么办法可以给它刷个守护
    14 replies  •  2019-08-15 16:36:00 +08:00
    soulzz
        1
    soulzz  
       Aug 15, 2019   ❤️ 1
    winsw
    wqawd520
        2
    wqawd520  
       Aug 15, 2019   ❤️ 1
    百度 windows 服务,就行了
    jay4497
        3
    jay4497  
       Aug 15, 2019   ❤️ 1
    作为 Windows 服务么,可以看看 NSSM。
    hihipp
        4
    hihipp  
       Aug 15, 2019   ❤️ 1
    目前最优解应该就是 3 楼说的 NSSM。
    lihongjie0209
        5
    lihongjie0209  
       Aug 15, 2019   ❤️ 1
    NSSM
    littlepython
        6
    littlepython  
    OP
       Aug 15, 2019
    刚刚试了一下 nssm 这个要交 python 脚本打包成 exe 文件吗 @hihipp
    littlepython
        7
    littlepython  
    OP
       Aug 15, 2019
    @soulzz 这个也需要打包成 exe ?
    arrow8899
        8
    arrow8899  
       Aug 15, 2019   ❤️ 1
    https://stackoverflow.com/questions/32404/how-do-you-run-a-python-script-as-a-service-in-windows
    这上面有几种方法,你试下
    sc create PythonApp binPath= "C:\Python34\Python.exe --C:\tmp\pythonscript.py"
    soulzz
        9
    soulzz  
       Aug 15, 2019   ❤️ 1
    @littlepython 不需要 这个是通过别人打包好的应用注册为服务再调用你的指令
    littlepython
        10
    littlepython  
    OP
       Aug 15, 2019
    @soulzz 你说的这个方法成功了 有一点没试过 多个脚本是不是只用设置在一个 xml 里面写就可以
    soulzz
        11
    soulzz  
       Aug 15, 2019   ❤️ 1
    多个脚本建议放在不同文件夹下取不同名字避免混淆
    littlepython
        12
    littlepython  
    OP
       Aug 15, 2019
    @jay4497 nssm 设置成功了 yeah
    littlepython
        13
    littlepython  
    OP
       Aug 15, 2019
    @arrow8899 谢谢 这个里面的 nssm 里面设置成功 那个命令的出了些问题
    wuwukai007
        14
    wuwukai007  
       Aug 15, 2019
    alwaysup
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2342 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 16:06 · PVG 00:06 · LAX 09:06 · JFK 12:06
    ♥ Do have faith in what you're doing.