readXlsxFile.py

import xlrd
from DataCleaning.library.functions.changeDirectory import *

# read and return .xlfx/.XLFX file with file name: fname
def readXlsxFile(fname, wd = ""):
tempWD = os.getcwd()
if wd != "":
os.chdir(wd)
else:
development2Raw()
bk = xlrd.open_workbook(fname)
os.chdir(tempWD)
return bk

def readXlsxFileInExternal(fname):
tempWd = os.getcwd()
# development2External()
os.chdir("D:\\DCG_PRF_Data_Team\\DataCleaning\\library\\external")
bk = xlrd.open_workbook(fname)
# external2Development()
os.chdir(tempWd)
return bk
posted @ 2021-10-05 20:31  石棠  阅读(57)  评论(0编辑  收藏  举报