Single-file wrapper for Qt for educational purposes.
- single window apps or games
- graphics and animations (emojis, PNG, JPEG, GIF, ...)
- sound and music (WAV)
- mouse and keyboard (WASD) control
- popup input forms
- Python 3.5+
- Qt 5.12+ (PyQt5, PySide2) or Qt 6 (PyQt6, PySide6)
Put engine.py in apps directory or Python's path
On Linux, you can start the files like this:
PYTHONPATH=. python3 games/game-memory3.py
Hello world in engine.py:
from engine import App app = App() app.text = "Hello, world!" app.exec()
Ping-Pong animation:
from engine import App, Emoji def ping(): if ball.x > 600: ball.vx = -5 app.frame = pong def pong(): if ball.x < 10: ball.vx = 5 app.frame = ping app = App() ball = Emoji('softball') ball.center_in(app.area) ball.vx = 5 app.show(ball) app.frame = ping app.exec()
More examples provided in the repository.