🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

py-hot-reload

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

py-hot-reload

Python Hot Reload starts the given program and reloads it whenever any file changes in the current directory or imported modules.

1.0.6
96

Supply Chain Security

100

Vulnerability

98

Quality

100

Maintenance

100

License

Maintainers
1

Python Hot Reload

Python Hot Reload starts the given program and reloads it whenever any file changes in the current directory or imported modules.

Installation

You can install the Python Hot Reload from PyPI:

python -m pip install py-hot-reload

Python Hot Reload is supported on Python 3.6 and above.

How to use

Python Hot Reload has a command line implementation called py-hot-reload. To see help message, call the program with -h, --help:

$ py-hot-reload -h
Usage: py-hot-reload [OPTIONS] PYTHON_FILE

Options:
-V, --version                   Show the version and exit.
-C, --copyright                 Show the copyright and exit.
-v, --verbose                   Verbose.
-ep, --extra-patterns TEXT      Extra patterns
-ip, --ignore-patterns TEXT     Ignore patterns
-i, --interval INTEGER          Interval
--add-current-folder-to-patterns
                                Add current folder to patterns.
--ignore-venv-and-python-lib    Ignore venv and python lib.
-h, --help                      Show this message and exit.

To run ignoring certain patterns, run using -ip, --ignore-patterns:

$ py-hot-reload -ip="*.txt;*/dir/*" <python-file>

To run with extra patterns, run using -ep, --extra-patterns:

$ py-hot-reload -ep="*.txt;*/dir/*" <python-file>

You can also call the Python Hot Reload in your own Python code, by importing from the py_hot_reload package:

import py_hot_reload

def main():
    print(1)

py_hot_reload.run_with_reloader(main)

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts