Skip to content

Instantly share code, notes, and snippets.

@neelratanguria
Created March 30, 2022 16:43
Show Gist options
  • Save neelratanguria/e841b5474fcb83410ea663f934563a27 to your computer and use it in GitHub Desktop.
Save neelratanguria/e841b5474fcb83410ea663f934563a27 to your computer and use it in GitHub Desktop.
def append_parent_path():
import sys
import os
# getting the name of the directory
# where the this file is present.
current = os.path.dirname(os.path.realpath(__file__))
# Getting the parent directory name
# where the current directory is present.
parent = os.path.dirname(current)
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment