为什么 pyGame 或 pyglet 不支持 python 3?
我一直在研究 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我什至不明白你的问题,因为 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.
我正在 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.
您链接到的页面上“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.
他们不支持Python 3,因为还没有人让他们支持Python 3。这是一个奇怪的问题。 :-)
PyGame 似乎主要支持 Python 3。存在一些问题:(来自 http:// /www.pygame.org/wiki/python3porting?parent=todo )
没有任何地方说它不适用于 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 )
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.
pyglet 1.2(截至 2012 年 7 月的 Alpha 版本)可与 Python 3 配合使用。
pyglet 1.2 (alpha as of July 2012) works with Python 3.