Skip to content

Instantly share code, notes, and snippets.

@chrisvoncsefalvay
Last active April 12, 2017 20:00
Show Gist options
  • Select an option

  • Save chrisvoncsefalvay/7e22bfeb5f935a21e1047fa91040a009 to your computer and use it in GitHub Desktop.

Select an option

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