Relative imports that actually work
Project description
Install
pip install python-include
Use
import python_include
# import [name] from-anywhere (doesnt pollute global namespace)
hello = python_include.file("./path/to/file/with/hello/func/code.py", {"__file__":__file__}).hello
hello()
# import [*everything*] from-anywhere (does pollute global namespace)
python_include.file("./path/to/file/with/hello/func/code.py", globals())
hello() # function that was defined inside that^ "code.py"
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
python_include-2.0.0.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for python_include-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ea2a8d95f7da3de211cb094a20e7a5f7b7d1c8441a998a785e1465234f197da |
|
MD5 | 239e04bc8539f88415e6aa3e2658c133 |
|
BLAKE2b-256 | 490864bfd7ea1eb7bce6eedbb4f6c22e286d935f835847276a99463962898a92 |