Paul Sender
Paul Sender

Reputation: 488

How can I run a python program in the background using python's Command Line Scripts?

I currently have my program set up to run with Command Line Scripts (https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html) like so:

 "console_scripts": ["app_name = app_name.app:main"],

How can I make it so that this program runs in the background like pythonw does?

Upvotes: 0

Views: 55

Answers (1)

Charles Duffy
Charles Duffy

Reputation: 295696

Instead of console_scripts, something that should be run as a GUI application goes in gui_scripts.

 "console_scripts": ["app_name = app_name.cli:command_line"],
 "gui_scripts": ["app_name = app_name.gui:start_window"],

See https://packaging.python.org/en/latest/specifications/entry-points/

Upvotes: 2

Related Questions