addPath.py

import os
import sys

# add path to lib env
def addPath(target, scriptPath):
## Add path 'project\src\target' to system path
os.chdir(scriptPath)
# change working directory to 'project\src\target'
os.chdir(os.path.abspath('..\\' + target))
# add path 'project\src\functions' to system path
sys.path.append(os.getcwd())
# change working directory back to 'project\src\development'
os.chdir(os.path.abspath('..\\development'))

def addAbsolutePath(target):
sys.path.append(target)
posted @ 2021-10-05 20:17  石棠  阅读(63)  评论(0编辑  收藏  举报