How do you run a Python script as a service in Windows?

后端 未结 13 1821
你的背包
你的背包 2020-11-22 02:18

I am sketching the architecture for a set of programs that share various interrelated objects stored in a database. I want one of the programs to act as a service which prov

13条回答
  •  余生分开走
    2020-11-22 02:47

    https://www.chrisumbel.com/article/windows_services_in_python

    1. Follow up the PySvc.py

    2. changing the dll folder

    I know this is old but I was stuck on this forever. For me, this specific problem was solved by copying this file - pywintypes36.dll

    From -> Python36\Lib\site-packages\pywin32_system32

    To -> Python36\Lib\site-packages\win32

    setx /M PATH "%PATH%;C:\Users\user\AppData\Local\Programs\Python\Python38-32;C:\Users\user\AppData\Local\Programs\Python\Python38-32\Scripts;C:\Users\user\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pywin32_system32;C:\Users\user\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\win32
    
    1. changing the path to python folder by

    cd C:\Users\user\AppData\Local\Programs\Python\Python38-32

    1. NET START PySvc
    2. NET STOP PySvc

提交回复
热议问题