Skip to content

Instantly share code, notes, and snippets.

@isezen
Created April 22, 2016 06:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isezen/a1ed752f170d8ebdfd30baf4d066017e to your computer and use it in GitHub Desktop.
Save isezen/a1ed752f170d8ebdfd30baf4d066017e to your computer and use it in GitHub Desktop.
get path from __file__ or os.getcwd()
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