Skip to content

Instantly share code, notes, and snippets.

@realamirhe
Created February 3, 2025 12:16
Show Gist options
  • Select an option

  • Save realamirhe/dd3b24a414dfd56ab2ae7ea4eae0b68d to your computer and use it in GitHub Desktop.

Select an option

Save realamirhe/dd3b24a414dfd56ab2ae7ea4eae0b68d to your computer and use it in GitHub Desktop.
Resolve the root folder for package loading in nested jupyter files for r&d
import sys
import os
while ".gitignore" not in os.listdir():
os.chdir("..")
root_path = os.getcwd()
if root_path not in sys.path:
sys.path.append(root_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment