Windows:从可点击图标运行python命令 [英] Windows: run python command from clickable icon

查看:165
本文介绍了Windows:从可点击图标运行python命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Cygwin运行的python脚本,我想在Windows桌面上创建一个可单击的图标,该图标可以运行此脚本而无需打开Cygwin并手动输入命令.我该怎么办?

I have a python script I run using Cygwin and I'd like to create a clickable icon on the windows desktop that could run this script without opening Cygwin and entering in the commands by hand. how can I do this?

推荐答案

最简单的解决方案是创建批处理文件包含以下命令:

The simplest solution will be creating batch file containing command like:

c:\python27\python.exe c:\somescript.py

使用此解决方案,您将必须安装python解释器.如果您需要更多便携式解决方案,可以尝试例如 py2exe 并将python脚本捆绑到可执行文件中,无需安装Python即可运行.

With this solution you will have to have installed python interpreter. If you need more portable solution you can try for e.g. py2exe and bundle python scripts into executable file, able to run without requiring a Python installation.

这篇关于Windows:从可点击图标运行python命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆