Skip to content

Instantly share code, notes, and snippets.

@xacrimon
Last active February 10, 2018 20:56
Show Gist options
  • Save xacrimon/a3ebe881273a102a09bd3816e4dcf50b to your computer and use it in GitHub Desktop.
Save xacrimon/a3ebe881273a102a09bd3816e4dcf50b to your computer and use it in GitHub Desktop.
Useful script onelines
# Get the parent directory of the directory where in the program resides in python
os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
# Get the directory of the current running script in shell
"$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment