Skip to main content

Hot-swapper for Python

Project description

Hotswap for Python

Install

pip install hotcodeswap

Usage

Decorate the main function with @hotswap.main

Example

import hotswap
from time import sleep

def function():
    print('hoge')

class Calculater:

    def add(self, x, y):
        return x + y

@hotswap.main # add this to main function
def main():   # cannot be hot-swapped to the main function
    calc = Calculater()
    while True:
        function()
        print(calc.add(2, 3))
        sleep(1)

if __name__ == '__main__':
    main()

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

hotcodeswap-1.0.1.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

hotcodeswap-1.0.1-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

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