我知道我可以在Linux上运行Python脚本。
From the terminal by
./hello_world.py
.From the file manager by clicking on the file.
...包括shebang并将文件标记为可执行文件之后。
但是,选项1要求我手动打开终端并键入文件名,选项2不会显示脚本的任何输出(例如打印语句和错误消息),因为不会打开任何输出窗口,因此脚本只会在后台运行。
如何配置脚本文件或Linux(在我的情况下为Kubuntu 20.04)安装程序,以便从文件管理器启动* .py文件将在终端窗口中自动将其打开,从而显示程序输出?