Skip to content

Instantly share code, notes, and snippets.

@barbietunnie
Last active December 7, 2022 00:11
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 barbietunnie/11b0499f173e3a3c7e1226c0f2dc7450 to your computer and use it in GitHub Desktop.
Save barbietunnie/11b0499f173e3a3c7e1226c0f2dc7450 to your computer and use it in GitHub Desktop.
Working with relative paths in Python
import os
ROOT_DIR = os.path.realpath(os.path.join(os.path.dirname(__file__), '..'))
import os
from config.definitions import ROOT_DIR
print(os.path.join(ROOT_DIR, 'data', 'users.xlsx'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment