Created
February 3, 2025 12:16
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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