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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fakemod-0.1.0.zip
(6.0 kB
view details)
File details
Details for the file fakemod-0.1.0.zip.
File metadata
- Download URL: fakemod-0.1.0.zip
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/43.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cca9e2636001103311763dbe864371cdd1ee41c6e246ed4a2b261074447ffa7e
|
|
| MD5 |
f29ef0d850ad3ee4583fa37c492df102
|
|
| BLAKE2b-256 |
080be7be5c45f74e3babe4b46853ff7e0bfd3935942b4d0904af498f42d3719f
|