Hot code reloading for python scripts with a main loop
Project description
minireload
Hot code reloading for python scripts with a main loop. Basically just a nicer front-end for superreload + exception handling. Requires only the python standard library and no external dependencies.
Setup
Available via pip:
pip3 install minireload
Usage
import minireload as mr
class Main:
def do_update(self):
"""
This function will be called in a while loop. Do your wörk here!
"""
work()
work()
work()
def handle_exc(self, exc):
"""
If an exception occured during execution or reload, minireload tries to
call this function, allowing the user to define custom exception handling.
"""
print('Help!')
if __name__ == '__main__':
mr.launch(Main, 'do_update', exc_func_name='handle_exc')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
minireload-0.0.3.tar.gz
(7.3 kB
view hashes)
Built Distribution
Close
Hashes for minireload-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4eb5a1c3edac3329ff1d24cb8af8e3951893e3f3b2561173962549cb743154f6 |
|
MD5 | 914ae82c56f7a9d00cc1fc21aeca702b |
|
BLAKE2b-256 | e90aadfc0bd4e6278d30c8420d55acda7695d9b2d7847d45e0dcbe85695459b0 |