Python - 运行 pygame

标签 python pygame

我使用 Pygame 创建了一个简单的游戏。是否可以在未安装 Pygame 的其他计算机上运行该游戏? 我尝试编写一个 BATCHT 文件,它使用 pip 安装 Pygame。但它也不起作用。

最佳答案

要让您的游戏在其他未安装 pygame 的计算机上运行,​​您需要使其可执行。以下包可以使您的脚本可执行:

  1. pyinstaller
  2. py2exe

教程

  1. Converting to executable using pyinstaller
  2. Converting to executable using py2exe

Pyinstaller 比 py2exe 简单多了。但它们都非常有效!

关于Python - 运行 pygame,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54492270/

相关文章:

python - 让pygame Sprite 在python中消失

python - 图片不更新pygame

python - 如何通过重新启动应用程序来克服ModbusTcpServer中的 "Address already in use"?

python - numpy 数组中的整数溢出

python - 如何正确转换列表的输出值以将它们用作函数内的参数?

python - 在 SQLAlchemy 中使用字典/数据帧值执行更新

python - math.pi 在 pygame 中未按预期工作

pygame - pygame中的collidepoint函数是如何工作的?

python - pygame 不适用于可移植 python

python - 与线程一起使用时,使用 pywinauto.top_window() 会挂起