Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@marcellmars
Created May 11, 2011 11:23
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 marcellmars/966303 to your computer and use it in GitHub Desktop.
Save marcellmars/966303 to your computer and use it in GitHub Desktop.
python script finds its own current path
#!/usr/bin/env python
import os
mypath = os.path.dirname(os.path.realpath(__file__))
if __name__ == '__main__':
print mypath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment