最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - How to create desktop icon to open python3 shell and run .py in the background? - Stack Overflow

programmeradmin0浏览0评论

OSX 12.7.6 Python 3

I have a file RGB_plot.py that I want to run in Python shell, with the terminal window staying hidden, using a shortcut on my desk top.

I have tried the shortcut.app with no luck. I've search here and elsewhere for some idea on how to do this , also with no luck.

I presently open the file in VSC, copy, open terminal, shell to Python3, then paste. This generates a 3D graph plot which pulls data from .xlsx

Is there a way to just click on a desktop icon and make it run?

OSX 12.7.6 Python 3

I have a file RGB_plot.py that I want to run in Python shell, with the terminal window staying hidden, using a shortcut on my desk top.

I have tried the shortcut.app with no luck. I've search here and elsewhere for some idea on how to do this , also with no luck.

I presently open the file in VSC, copy, open terminal, shell to Python3, then paste. This generates a 3D graph plot which pulls data from .xlsx

Is there a way to just click on a desktop icon and make it run?

Share Improve this question edited Nov 19, 2024 at 19:15 Christoph Rackwitz 15.6k5 gold badges39 silver badges51 bronze badges asked Nov 19, 2024 at 17:54 Stainless BrownStainless Brown 95 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Create a .bat file containing pythonw "C:\path\to\script.py". Use pythonw to run the script without a visible console. Create a shortcut to the .bat file on the desktop, set it to run minimized, and customize the icon.

发布评论

评论列表(0)

  1. 暂无评论