Current module relative paths and imports
Project description
Get the path of a file relative to the current module. Import a Python module relative to the current module. Temporarily change sys.path for imports.
Installation
$ pip install current
Usage
Get paths relative to the current module:
>>> import current
>>> here = current.current_path()
>>> parent = current.current_path('..')
>>> bruces = current.current_path('..', 'australia', 'bruces', 'bruces.ini')
Temporarily add the parent directory to sys.path:
>>> with current.inserted_path()
... import australia
License
Changelog
Version 0.1: First public release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
current-0.1.zip
(4.6 kB
view hashes)