Skip to content

Instantly share code, notes, and snippets.

@MareoRaft
Created November 19, 2021 20:31
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 MareoRaft/dbafd54926a8e936ed14748bf522a1dd to your computer and use it in GitHub Desktop.
Save MareoRaft/dbafd54926a8e936ed14748bf522a1dd to your computer and use it in GitHub Desktop.
The safe/recommended way to get a file / dir / repo path in python
import os
REPO_PATH = os.path.dirname(os.path.abspath(__file__))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment