Skip to content

Instantly share code, notes, and snippets.

@chrisvoncsefalvay
Last active April 12, 2017 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisvoncsefalvay/7e22bfeb5f935a21e1047fa91040a009 to your computer and use it in GitHub Desktop.
Save chrisvoncsefalvay/7e22bfeb5f935a21e1047fa91040a009 to your computer and use it in GitHub Desktop.
Context importing in Python
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import sample

Shamelessly stolen from Kenneth Reitz.

from .context import sample
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment