I already have a python script that runs continuously. It's very similar to this: https://github.com/walchko/Black-Hat-Python/blob/master/BHP-Code/Chapter10/file_monitor.py
Similar as in, when running it as a script, it opens a CMD which shows some data when stuff happens - it's not user-interactible so it's not mandatory that it shows (just in case someone wishes to point out that windows services can't have interfaces)
I've tried to convert it to a service. It starts for a fraction of a second and then automatically stops. When trying to start it via services.msc (instead of python script.py start) it doesn't start at all, Windows error says something like: "The service on local computer started and then stopped" which sounds just about what's happening if I try to start it with the argument.
I've tried modifying the script to allow it to run as a service - adding the skeleton I found here: Is it possible to run a Python script as a service in Windows? If possible, how?
I've also tried just getting the skeleton script above and just trying to make it run the other script with examples from here: What is the best way to call a Python script from another Python script?
Does anyone have any idea what the best course of action would be to run that script above as a service?
Thanks!