Skip to main content

Reloadable Modules and Namespace Packages

Project description

FakeMod

A utility to automatically reload a module if modified, or emulate a namespace package.

Example

import os
os.makedirs('./utilities', exist_ok=True)
with open('./utilities/tool.py', 'w') as f:
   f.write(r'''if 1:

    def func(a):
        print('func', a)

    ''')

import fakemod
mod = fakemod.at('./utilities')
mod.tool.func(123)

Usage

Place into __init__.py:

import fakemod; fakemod.local(vars())

Also place into local.py to allow for from . import local to access other files in the same directory.

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for fakemod, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size fakemod-0.1.0.zip (6.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page