Skip to main content

Run your pyxel applications, reloading when code / assets change

Project description

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
  2. Ensure pyxel.run is only called when run as a script
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)

if __name__ == "__main__":
    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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyxel_reload-0.1.0.tar.gz (293.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyxel_reload-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file pyxel_reload-0.1.0.tar.gz.

File metadata

  • Download URL: pyxel_reload-0.1.0.tar.gz
  • Upload date:
  • Size: 293.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for pyxel_reload-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6057e5a58b5001ba29739824073a83396c84664be584d09965e891f8c4f53c7f
MD5 241818ab0d27cfa038f953800bbb7f5f
BLAKE2b-256 fa8742b34f3c7174661fc931479eacb82f5ecd98f33c74df5e4c23ab3ed9c853

See more details on using hashes here.

File details

Details for the file pyxel_reload-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyxel_reload-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for pyxel_reload-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb02ff3e444a0f0721cbaf1ac7847716c8a446342560ef16c7af89194bf921cd
MD5 2d945e996e98935925392c1b322bd803
BLAKE2b-256 c3260fc13197d121789091832fb8efa07815a048c1a2716bbb66131e8957a63f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page