0

I couldn't find any answers to this question posted by others, so here is my question:

Is it possible to have a python program run without displaying the code or opening any windows? This file does not print anything, so the shell file or code opening up is a distraction. Should I just try to convert it into a .exe file? And if there is a way to run a python file without opening any window, would it work only on PC or also on a mac?

  • Welcome to SO! I'm not sure what you mean. If you execute a .py file without a GUI it does just this. – ggorlen Aug 16 '20 at 05:35
  • Yes, you can run a python file without opening any window on any/all OSes – monkut Aug 16 '20 at 05:37
  • Okay. Thank you for the information. I appreciate it! – Anonymous User Aug 16 '20 at 05:39
  • See if this helps. https://stackoverflow.com/questions/2975624/how-to-run-a-python-script-in-the-background-even-after-i-logout-ssh. and https://stackoverflow.com/questions/43916158/run-python-script-in-the-background – Joe Ferndz Aug 16 '20 at 05:40
  • If you mean for MS-Windows, check this: https://stackoverflow.com/questions/9705982/pythonw-exe-or-python-exe – adrtam Aug 16 '20 at 05:41

1 Answers1

0

In cmd do the following...

pythonw yourscript.py

This can be especially useful when you are doing a desktop notification model