简体   繁体   中英

Can I run an PySide2 application as a Windows Background Process

I want that the app accept an input from the user and then go into the background as a Windows Background Process. So, is that even possible? If yes then how?

I am using Python 3.6.8 and the PySide2 gui framework

You can run an external background process with pythonw.exe . You will have to run it by using subprocess or via Qprocess in pyside.

import subprocess
subprocess.run(["pythonw.exe", "path/to/your/program"])

This will run your program in the background with no visible process or way to interact with it. You can only terminate it with a system monitor

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM