Start with pyglet or pygame?

Question:

I would like to know what is the best to start with, pyglet or pygame? Which one is faster and which one is more active?

I would also like to know if pyglet will get python 3 support, because I have read here that it might not be possible or it would take a long time.

Would it be better to choose pygame, because of the python 3 support, or should I go with pyglet?

Thanks.

Asked By: Reshure

||

Answers:

pygame is richly active, witness the Aug release of 1.9 with nokia s60 support, enhanced py2app/py2exe support, and a bevvy of experimental features (support for Python 3.1, webcams, gfx, …). Books like Hello World and periodic, fun competitions like ludumdare and pyweek bear witness to the vitality of its community and ecosystem.

pyglet has a neat, newer API, and is convenient (pure Python, BSD license instead of LGPL).

As for speed, I’ve run no benchmarks but I gather that out of the box pyglet is better at exploiting advanced HW acceleration for 3D work, while pygame is better at 2D work and on HW that’s nowhere as advanced (smart phones, netbooks, etc, don’t have shiny 3D HW accelerators). You can enhance both frameworks’ speed with add-ons, though that does lose convenience.

In terms of Py3 support etc, I believe the issue is simply that pygame, much more mature and popular, has a vastly larger core development group, so of course it can get new things like Py3 support out of the gate earlier.

If none of the above issues is decisive for you (you’re fine with LGPL vs BSD, don’t care much about smartphones, need no books, etc, etc), the only sensible approach is really to download both and try the same elementary tasks of your interest on machines of your interest — that will tell you how well each “fits your brain”, your need for speed, convenience, and so forth.

Answered By: Alex Martelli

This seems like a duplicate of: Differences between Python game libraries Pygame and Pyglet?

That is at least one place to look for additional answers.

I attended Steve Johnson’s talk on pyglet at PyOhio (Talk #18 at http://pyohio.org/2009/Talks/) and came away quite impressed with just how little code was involved. pygame seems large and I (personally) do not care for all the extra dependencies.

That said, I haven’t yet written any code for either. My plan is to start with pyglet and then after I’m comfortable with it, try pygame and see how they compare.

I concur with Alex’s response, if you google for pygame vs. pyglet, you’ll find a lot of personal preferences. About the only objective difference I saw was the difference in how many graphics cards are supported (pygame doesn’t require OpenGL so pygame can support more).

Answered By: user135331

I cannot comment other answers, so I have to make this new one, sorry.

Speed-wise, Pyglet is definitely faster than pygame out-of-the-box, and speed is always a concern when developing with pygame (you have to update the smallest parts of screen, and remembering what has changed can be tedious). There is no such issue with pyglet.

If you use cocos2d (a layer above pyglet) speeding-up things is even easier, just attach sprites to a BatchNode, and watch the FPS rise.

As said in a comment pyglet as python3 support.

It’s just my personal preference, but I like Pyglet much more, and with cocos2d on top, it’s really easy to learn. The downside is the much smaller community.

Answered By: CGGJE
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.