Skip to main content

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()

Release files for hotcodeswap 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hotcodeswap 1.0.1
File Size Uploaded
hotcodeswap-1.0.1.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hotcodeswap 1.0.1
File Interpreter ABI Platform
hotcodeswap-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / hotcodeswap-1.0.1.tar.gz

Download URL hotcodeswap-1.0.1.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d28d341192ac18fa62b1565562e10ae847ce675e4b120e7acdfd7837751e533e
BLAKE2b-256 checksum
How to use checksums
36819095affcd59007d270001f6ae34120bb7663f32efd66fa3fa64836c2bcd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / hotcodeswap-1.0.1-py3-none-any.whl

Download URL hotcodeswap-1.0.1-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce399e1d6fcf9a3410e0ca785caa33254c35119e4b830d11fd8509c4e29bb21b
BLAKE2b-256 checksum
How to use checksums
fc968f0cdbb94591b70919f7426729148ab5bffc4aa04f2fb253e5882ab4304e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release history Release notifications | RSS feed

This release

1.0.1 This release

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