pyxel-reload
A hot-reloading development tool for Pyxel games that automatically refreshes your game when code or asset files change.
Features
- Hot reloading of Python code changes
- Automatic reloading when .pyxres asset files change
- Error display in both console and game window
- Simple integration with existing Pyxel games
Installation
Install via pip:
pip install pyxel-reload
Usage
- Ensure your game file has an
updateanddrawfunction
import pyxel
pyxel.init(160, 120)
def update():
if pyxel.btnp(pyxel.KEY_Q):
pyxel.quit()
def draw():
pyxel.cls(0)
pyxel.text(10, 10, "Hello, Pyxel!", pyxel.frame_count % 16)
pyxel.run(update, draw)
- Run your game with pyxel-reload:
pyxel-reload game
Where game is the name of your Python module (without the .py extension).
- Make changes to your code or .pyxres files and see them reload automatically!
Error Handling
When errors occur during reload:
- Error details are displayed in the console
- A basic error message appears in the game window
- The game continues running and will reload once errors are fixed
Run code before reload
If you need to run some code before the game is reloaded, you can define a
on_unload function in your game module:
def on_unload():
stop_music()
Metadata
Release files for pyxel-reload 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyxel_reload-0.2.2.tar.gz | 293.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyxel_reload-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 298.6 kB
Release files / pyxel_reload-0.2.2.tar.gz
| Download URL | pyxel_reload-0.2.2.tar.gz |
|---|---|
| Size | 293.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0798471fb2b7582f58e02b8d686155de8f7fa610db408392508bcb5a87f31abf
|
|
BLAKE2b-256 checksum How to use checksums |
4cae5b1af566aa3f230884ea836b0d40662e4dbd982f387f51a2f910737e87b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.15
|
Release files / pyxel_reload-0.2.2-py3-none-any.whl
| Download URL | pyxel_reload-0.2.2-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c98e87bbb8303377ff1ac6aad1dd463635da4b1fdd03bfd8daadc65c1b40d07
|
|
BLAKE2b-256 checksum How to use checksums |
6665188ea18fb65018d110b566b37635202238fc41e5c15ba2ece5f0629a093d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.15
|