changeDirectory.py

import os


# change the current working directory from 'project\src\development' to 'project\volume\data\external'
def development2External(naming = ""):
if naming != "":
scriptPath = getScriptPath(naming)
os.chdir(os.path.abspath(scriptPath))
os.chdir(os.path.abspath('..'))
os.chdir(os.path.abspath('..\\volume\\data\\external'))

# change the current working directory from 'project\volume\data\external' to 'project\src\development'
def external2Development(naming = ""):
if naming != "":
scriptPath = getScriptPath(naming)
os.chdir(os.path.abspath(scriptPath))
# os.chdir(os.path.abspath('..'))
# os.chdir(os.path.abspath('..'))
# os.chdir(os.path.abspath('..\\src\\development'))

# change the current working directory from 'project\src\development' to 'project\volume\data\log'
def development2Log(naming = ""):
if naming != "":
scriptPath = getScriptPath(naming)
os.chdir(os.path.abspath(scriptPath))
os.chdir(os.path.abspath('..'))
os.chdir(os.path.abspath('..\\volume\\data\\log'))

# change the current working directory from 'project\volume\data\log' to 'project\src\development'
def log2Development(naming = ""):
if naming != "":
scriptPath = getScriptPath(naming)
os.chdir(os.path.abspath(scriptPath))
# os.chdir(os.path.abspath('..'))
# os.chdir(os.path.abspath('..'))
# os.chdir(os.path.abspath('..\\src\\development'))

# change the current working directory from 'project\src\development' to 'project\volume\data\raw'
def development2Raw(naming = ""):
if naming != "":
scriptPath = getScriptPath(naming)
os.chdir(os.path.abspath(scriptPath))
os.chdir(os.path.abspath('..'))
os.chdir(os.path.abspath('..\\volume\\data\\raw'))


# change the current working directory from 'project\volume\data\raw' to 'project\src\development'
def raw2Development(naming = ""):
if naming != "":
scriptPath = getScriptPath(naming)
os.chdir(os.path.abspath(scriptPath))
# os.chdir(os.path.abspath('..'))
# os.chdir(os.path.abspath('..'))
# os.chdir(os.path.abspath('..\\src\\development'))


# change the current working directory from 'project\src\development' to 'project\volume\data\Processed'
def development2Processed(naming = ""):
if naming != "":
scriptPath = getScriptPath(naming)
os.chdir(os.path.abspath(scriptPath))
os.chdir(os.path.abspath('..'))
os.chdir(os.path.abspath('..\\volume\\data\\Processed'))

# change the current working directory from 'project\volume\data\Processed' to 'project\src\development'
def processed2Development(naming = ""):
if naming != "":
scriptPath = getScriptPath(naming)
os.chdir(os.path.abspath(scriptPath))
# os.chdir(os.path.abspath('..'))
# os.chdir(os.path.abspath('..'))
# os.chdir(os.path.abspath('..\\src\\development'))


# change the current working directory from 'project\src\development' to 'project\volume\data\proof'
def development2Proof(naming = ""):
if naming != "":
scriptPath = getScriptPath(naming)
os.chdir(os.path.abspath(scriptPath))
os.chdir(os.path.abspath('..'))
os.chdir(os.path.abspath('..\\volume\\data\\proof'))

# change the current working directory from 'project\volume\data\proof' to 'project\src\development'
def proof2Development(naming = ""):
if naming != "":
scriptPath = getScriptPath(naming)
os.chdir(os.path.abspath(scriptPath))
# os.chdir(os.path.abspath('..'))
# os.chdir(os.path.abspath('..'))
# os.chdir(os.path.abspath('..\\src\\development'))

def getScriptPath(naming, rootLocal = "D:"):
return rootLocal + "\\DCG_PRF_Data_Team\\DataCleaning\\" + naming + "\\project\\src\\development"
上一篇:嵌入式Linux之定时器中断


下一篇:在Spring中配置JNDI数据源时碰到 javax.naming.NoInitialContextException错误的解决