Skip to main content

Watch target file/folder for changes in python files and import/reimport

Project description

watch_import

Watch_import uses watchfiles to observe a file or folder. When a file is saved it will re/import that file into the watch_import context.

Using as a file/folder watcher

> watch_import PATH/TO_PYTHON_FILES

Using as an import

from watch_import import watch_me

print('hello')
watch_me()

Example use-case OCP CAD Viewer

import cadquery as cq
from ocp_vscode import show
from watch_import import watch_me

body = cq.Workplane("XY").box(5, 10, 15)
show(body)

watch_me()

Run this file once and it will start watching and "re-run" once saved.

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

watch_import-0.0.2.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

watch_import-0.0.2-py3-none-any.whl (4.3 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