Skip to content

Instantly share code, notes, and snippets.

@Red-Eyed
Last active May 3, 2025 10:31
Show Gist options
  • Save Red-Eyed/1ae6395a0653fb1c0b9bf0dc679cfce5 to your computer and use it in GitHub Desktop.
Save Red-Eyed/1ae6395a0653fb1c0b9bf0dc679cfce5 to your computer and use it in GitHub Desktop.
notebook header
%load_ext autoreload
%autoreload 2
import os
import sys
from pathlib import Path
NOTEBOOK_DIR: Path = globals().get("NOTEBOOK_DIR", Path.cwd())
REPO_DIR = NOTEBOOK_DIR.parent
os.chdir(REPO_DIR)
sys.path.append(REPO_DIR.as_posix())
print(f"{NOTEBOOK_DIR=}")
print(f"{REPO_DIR=}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment