Skip to content

Instantly share code, notes, and snippets.

@planetceres
Created April 3, 2019 22:50
Show Gist options
  • Save planetceres/d20ade5f46531786320b0690586950aa to your computer and use it in GitHub Desktop.
Save planetceres/d20ade5f46531786320b0690586950aa to your computer and use it in GitHub Desktop.
Append sibling directory python
import os
dir_name = "directory_name"
cur_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.join(cur_path, dir_name))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment