I have created a file-sorting python script, and I would like it to run in the background. Right now, it opens up the terminal (I'm on mac) every time it runs, and I don't like that. I made it so it runs every time the computer is booted up. How can I make it windowless/ a background process using pyinstaller?
Asked
Active
Viewed 349 times
2 Answers
0
You can use os.system
. Something like this:
import os
os.system("pyinstaller <config> <filename>")
To make it run in the background, you could run it with pythonw
. If you want your script to run continuously, you could use the python module sched to schedule your script.

xilpex
- 3,097
- 2
- 14
- 45
-
I don't think you understand the question. I want the compiled python script to run as a background process. – Serket May 01 '20 at 19:59
-
@Serket -- I've updated my answer. – xilpex May 01 '20 at 20:02
0
Try this command and make an .exe file of your .py file,
pyinstaller -w filename.py
This command make an .exe file which will execute your script without popping any console. Means it will execute in background. For executing you script on boot up set check this

Ali Hassan Ahmed Khan
- 905
- 8
- 23