为什么 pyGame 或 pyglet 不支持 python 3?

发布于 2024-10-07 03:12:51 字数 371 浏览 0 评论 0原文

我一直在研究 python 的各种游戏设计模块,例如 pyglet 和 pyGame。我注意到这两个似乎都只与 python 2 兼容。鉴于 python 3 是最新版本,这是为什么呢?我使用 python 的经验是使用 python 3,那么有没有适合 python 3 游戏开发的好的框架/模块?或者我学习 python 2 并使用 pyglet 或 pyGame 会更好吗?

编辑:我会在 Mac 上使用 pyGame。下载页面 http://www.pygame.org/download.shtml 仅包含 py2.6 的链接, py2.5 和 py2.4,这让我相信它与 python 3 不兼容。

I have been looking into various game design modules for python such as pyglet and pyGame. I have noticed that both of these seem to only be compatible with python 2. Seeing as python 3 is the most current version, why is this? My experience with python has been with python 3, so are there good frameworks/modules out there for python 3 game development? Or would I be better off learning python 2 and using pyglet or pyGame?

edit: I would be using pyGame on a mac. The downloads page, http://www.pygame.org/download.shtml, only has links for py2.6, py2.5, and py2.4, which is what leads me to believe it is not python 3 compatible.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

2024-10-14 03:12:51

我什至不明白你的问题,因为 PyGame 从 1.9 版开始就与 Python 3 兼容:
http://www.pygame.org/wiki/python3porting?parent=todo

有一些小问题,但它可以与 Python 3 一起使用。

I don't even get your question, as PyGame is compatible with Python 3 since version 1.9:
http://www.pygame.org/wiki/python3porting?parent=todo

There are a few minor issues, but it is usable with Python 3.

梦里南柯 2024-10-14 03:12:51

我正在 Mac OSX 上使用 python 3 开发一个基于 pygame 的应用程序。它确实工作得很好,到目前为止我还没有遇到任何兼容性问题,尽管我发现了其他特定于 mac 的 pygame 错误。

也就是说,我可以肯定地确认它是有效的。

I'm developing a pygame-based application on Mac OSX with python 3. It definitely works fine, and so far I haven't run into any compatibility problems, though there are certainly other mac-specific pygame bugs that I have found.

That said, I can definitely confirm that it works.

晨敛清荷 2024-10-14 03:12:51

您链接到的页面上“Windows”下从顶部算起的第五个链接的名称中显然包含 py-3.1。

The fifth link from the top under "Windows" on the page you linked to clearly has py-3.1 in the name.

吃颗糖壮壮胆 2024-10-14 03:12:51

他们不支持Python 3,因为还没有人让他们支持Python 3。这是一个奇怪的问题。 :-)

PyGame 似乎主要支持 Python 3。存在一些问题:(来自 http:// /www.pygame.org/wiki/python3porting?parent=todo

  • 完成 unicode 文件名处理(fsencoding 分支),然后合并回主干(到 2010 年 9 月中旬)。
  • 更新文档以解释 Pygame 中的 Unicode
  • 制定开放 Python 3 IOBase 对象的最终解决方案:如何检查 C 中的抽象类型。(2010 年 9 月 1 日)也许最实用的解决方案就是只进行鸭子类型。
  • _movie - 推迟到模块准备好发布
  • 废料(是否有一些 C 字符串内容使移植变得困难)
  • 相机 - 该模块的状态是什么?

没有任何地方说它不适用于 Mac 上的 Python 3,而且似乎不太可能是这种情况。所以你可以尝试,但你必须自己编译。

Pyglet 没有提到 Python 3,所以它可能没有被移植。

They don't support Python 3, because nobody has made them support Python 3 yet. It's a bizarre question. :-)

PyGame seems to mostly support Python 3. There are some issues: (from http://www.pygame.org/wiki/python3porting?parent=todo )

  • Complete unicode file name handling (fsencoding branch), then merge back into trunk (by mid Sept/10).
  • update documentation to explain Unicode in Pygame
  • work out final solution for open Python 3 IOBase objects: how to check abstract types from C. (Sept. 1, 2010) Probably the most practical solution is to just do duck typing.
  • _movie - deferred until module is ready for release
  • scrap (does some C string stuff that makes porting difficult)
  • camera - what is the status of this module?

Nowhere does it say that it doesn't work for Python 3 on mac, and it seems unlikely to that that this would be the case. So you can try, but you will have to compile it yourself.

Pyglet doens't mention Python 3, so it's probably not ported.

忆依然 2024-10-14 03:12:51

pyglet 1.2(截至 2012 年 7 月的 Alpha 版本)可与 Python 3 配合使用。

pyglet 1.2 (alpha as of July 2012) works with Python 3.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文