Skip to content

Instantly share code, notes, and snippets.

@ZhipengHe
Last active August 1, 2021 09:22
Show Gist options
  • Save ZhipengHe/a29171a8ca1802a722d733259d9aaa4d to your computer and use it in GitHub Desktop.
Save ZhipengHe/a29171a8ca1802a722d733259d9aaa4d to your computer and use it in GitHub Desktop.
Tips for importing my own python packages
import inspect
import os
import sys
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
import my_own_package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment