Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Import py files using their relative or absolute path.

Project description


import_file is meant to import a python script from a normal file path. Relative (dotted) imports are complicated, and fixing sys.path just feels wrong.

Usage examples:

>>>from import_file import import_file
>>>mylib = import_file('c:\')
>>>another = import_file('relative_subdir/')

So now you aren’t limited to importing only within your package or trail of files.

This should work for python 2.5-3.2 and it’s public domain, have fun.

Project details

Download files

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

Files for import_file, version 1.11
Filename, size File type Python version Upload date Hashes
Filename, size (6.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page