Pyglet is written entirely in Python. Images, video, and sound files in a range of formats can be done natively but can also be expanded with the libav and ffmpeg libraries. It requires no external dependencies.3
Text display and formatting
Image and sprite work
Graphics
Events and file system
Sprites, text layouts, and text functions are implemented. Multi-level lists are supported and can be created using HTML. Different sections of the displayed document can have distinct styles. A built-in caret provides support for text editing, resembling many features of a UI text input caret.
In this example, lines 1-2 import the pyglet module's necessary components. Line 4 creates a window, and line 6 calls pyglet to run its event loop. Optionally an update rate (in frames per second) can be specified in a rate parameter.
Briggs, Anthony (2012-02-12). Hello! Python. Simon and Schuster. ISBN 978-1-63835-152-8. 978-1-63835-152-8 ↩
Paz, Alejandro Rodas de; Howse, Joseph (2015-09-28). Python Game Programming By Example. Packt Publishing Ltd. ISBN 978-1-78528-391-8. 978-1-78528-391-8 ↩
Choudhury, Ambika (2020-06-12). "Top Python Frameworks For Game Development". Analytics India Magazine. Retrieved 2024-04-12. https://analyticsindiamag.com/top-9-python-frameworks-for-game-development/ ↩