Skip to content

Instantly share code, notes, and snippets.

@npinto
Created October 17, 2012 08:33
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