python:有没有办法将python程序显示为普通应用程序? [英] python: is there any way for a python program to be displayed as a normal app?

查看:36
本文介绍了python:有没有办法将python程序显示为普通应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 PyGame 在 python 中创建游戏.我有一个想法,想知道脚本是否有可能有一个快捷方式"?显示在桌面上,并以与实际应用程序类似的方式显示.

I am creating a game in python using PyGame. I had an idea, and was wondering if it is possible for the script to have a "shortcut" displayed on the desktop, and for it to appear in a similar way to actual apps.

例如,应用在手机中的显示方式,例如 chrome.

For example, the way apps appear in a phone, such as chrome.

推荐答案

是的,我已经做到了...你所要做的就是创建一个 python 文件的快捷方式,并将其移动到桌面目录.我附上了桌面图标的截图.

Yes, I have done that... All you have to do is create a shortcut of the python file, and move it to the desktop directory. I have attached a screenshot of the icon on the desktop.

或者如果您已经完成开发,请使用 Pyinstaller 将其转换为可执行文件 (*.exe),这是您的普通 Windows 应用程序格式.即使没有安装 Python,它也可以在所有 Windows PC 上运行.这是我制作成可执行文件的 python 应用程序的屏幕截图.

or if you have already finished developing, use Pyinstaller to convert it to an executable(*.exe) which is your normal windows app format. It will run on all Windows PCs, even without Python installed. Here is a screenshot of a python app that I have made into an executable.

这是一个 GitHub 存储库,其中包含一些我制作并上传为可执行文件的游戏.它还有一个简单但令人讨厌的 Discord 机器人的代码.

Here is a GitHub repo with a few games that I have made and uploaded as executables. It also has code for a simple but annoying Discord bot.

这篇关于python:有没有办法将python程序显示为普通应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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