0

I have a python script that is supposed to be running in the background. I used pyinstaller to create an executable file for the script. Now, this file opens up a terminal window. I don't have anything that is going to be printed on the terminal window, so I want it to close up just after starting up the process. How can I do that? Right now I just have a continous loop like this:

while True:
    myFunction()
    time.sleep(some-arbitrary-timeout-value)

2 Answers2

0

you can launch your script and detach it from the terminal console by :

ibra
  • 926
  • 9
  • 21
0

Based on the context given, I will give you several options here for you to choose:

  • python pyinstaller.py --noconsole yourscript.py You won't see the console window when executing your file.
  • nohup python your_executable.py & Keeps the script running even if you close the terminal
  • pythonw test.py similar to nohup, works on windows
  • 1
    i found the answer here https://stackoverflow.com/questions/30710725/how-to-hide-the-python-console-window-in-pyinstaller – Vedant Jumle Sep 26 '20 at 18:24