Skip to main content

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

  1. Ensure your game file has an update and draw function
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)
  1. Run your game with pyxel-reload:
pyxel-reload game

Where game is the name of your Python module (without the .py extension).

  1. 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)

Source distribution for pyxel-reload 0.2.2
File Size Uploaded
pyxel_reload-0.2.2.tar.gz 293.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyxel-reload 0.2.2
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page