python - 如何将 .py 转换为 .exe?

标签 python python-3.x pygame

最近,我发现了 pygame 制作的乒乓球游戏,我试图将其转换为 .exe 文件,但我不能。这是我尝试转换的代码的链接。 https://algorithm.joho.info/programming/python/pygame-pong/ (这个网站是日文的,代码在中间)

感谢您的帮助!!

最佳答案

pyinstaller最高兼容 python 3.6。

Install PyInstaller from PyPI:

pip install pyinstaller

Go to your program’s directory and run:

pyinstaller yourprogram.py

关于python - 如何将 .py 转换为 .exe?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53142587/

相关文章:

python - 如何为 GitPython 克隆/pull 函数编写单元测试?

python - 如何根据本地 csv 中的 where 子句从 pandas 访问 Google Bigquery 数据

python-3.x - 仅将最后一个 shell 命令的标准输出放入 Python 变量中

python-3.x - 扩展 tf.io.gfile.GFile 超过 100MB/s 的吞吐量

python - 如何修复 'NameError: sys not defined'

python - pygame中不播放背景音乐

python - 如何统计每个单词在句子中出现的次数,得到每个句子的分数?

python - 找到几个单词,如果删除一个字母将打印出这两个单词

在交互式 shell 中运行时与 pygame 一起使用时,Python.exe 没有响应

python - 在实际打印文档之前预览 PDF 文件并选择打印机