Created
April 19, 2013 15:46
-
-
Save c0ldlimit/5421209 to your computer and use it in GitHub Desktop.
#python open a file in the same directory as a python script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://stackoverflow.com/questions/4060221/how-to-reliably-open-a-file-in-the-same-directory-as-a-python-script?utm_source=feedly | |
__location__ = os.path.realpath( | |
os.path.join(os.getcwd(), os.path.dirname(__file__))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment