Created
March 29, 2017 01:45
-
-
Save y16ra/20158615453dcc8e4bb6f656c8955e13 to your computer and use it in GitHub Desktop.
pythonでファイル位置から1つ上のディレクトリをsys.pathに追加する
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 | |
sys.path.append(path.normpath(path.join(path.dirname(path.abspath( __file__ )), '..'))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sys.pathはモジュール読み込み対象パスになる