Skip to content

Instantly share code, notes, and snippets.

@npinto
Created October 17, 2012 08:33
Show Gist options
  • Save npinto/3904425 to your computer and use it in GitHub Desktop.
Save npinto/3904425 to your computer and use it in GitHub Desktop.
How to reliably open a file in the same directory as a Python script
import os
from os import path
__location__ = path.realpath(path.join(os.getcwd(), path.dirname(__file__)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment