Created
April 22, 2016 06:51
-
-
Save isezen/a1ed752f170d8ebdfd30baf4d066017e to your computer and use it in GitHub Desktop.
get path from __file__ or os.getcwd()
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
import os | |
if '__file__' in globals(): | |
cdir = os.path.dirname(os.path.realpath(__file__)) | |
else: | |
cdir = os.getcwd() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment