Running Python Script as a Windows background process

I am trying to encode a python script that reads data from a serial port. It worked well from the command line, but I need it to run as a background process without any command line interface. The script has a while loop that reads the next byte of data from the serial port and simulates a keystroke, respectively. To press keys in the current window, instead of the python command line, I need a script to run in the background. I read a few answers here, but didnโ€™t call anything for me. Please point me in the right direction.

+5
source share
1 answer

On Windows, you can run a Python script in the background using the pythonw.exe executable. This will launch your program in the background, without a visible process or way of interacting with it. You also cannot complete it without a system monitor. More about pythonw.exe here: pythonw.exe or python.exe?

Good luck

+15
source

Source: https://habr.com/ru/post/1232398/


All Articles