简体   繁体   English

如何使用 python 的命令行脚本在后台运行 python 程序?

[英]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:我目前将我的程序设置为使用命令行脚本( https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html )运行,如下所示:

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

How can I make it so that this program runs in the background like pythonw does?我怎样才能让这个程序像 pythonw 一样在后台运行?

Instead of console_scripts , something that should be run as a GUI application goes in gui_scripts .而不是console_scripts ,应该作为 GUI 应用程序运行的东西放在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/请参阅https://packaging.python.org/en/latest/specifications/entry-points/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用python中的click制作命令行程序,该命令采用运行不同脚本的单独命令参数? - How do I make a command line program using click in python that takes separates command parameters that run different scripts? 如何从命令行使用 gimpfu 运行 python 脚本? - How to run python scripts using gimpfu from command line? Python 3.9中如何通过命令行运行程序 - How to run the program by command line in Python 3.9 如何使用./ 通过 Python 脚本执行命令行程序? - How can I execute command line program with ./ via a Python script? 如何从命令行运行多个Python脚本? - How to run multiple Python scripts from command line? python:如何从另一个程序中使用命令行调用(以用户的键击作为输入)运行程序? - python: how to run a program with a command line call (that takes a user's keystroke as input) from within another program? 如何使用python中的命令模块在后台运行命令? - How do I run a command in background using commands module in python? 如何使用Unix pass命令行程序使用Python自动设置密码 - How can I use Python to automate setting a password using the Unix pass command line program 如何使用通过模块sys运行的命令来获取Python程序? - How can I get a Python program to kill itself using a command run through the module sys? 如何使用python与命令行程序通信? - How to communicate with command line program using python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM