python获取当前文件路径 学习了:https://www.cnblogs.com/strongYaYa/p/7200357.html https://blog.csdn.net/heatdeath/article/details/78070832 https://www.cnblogs.com/WonderHow/p/4403727.html import os print(os.getcwd()) # for root, dirs, files in os.walk(os.getcwd()
当一个excel文件的sheet比较多时候, 这时候需要获取所有的sheet的名字. xl = pd.ExcelFile('foo.xls') xl.sheet_names # see all sheet names xl.parse(sheet_name) # read a specific sheet to DataFrame 也可以直接读取所有的sheet, 将sheetname设置为None. 这时候得到的是一个dict结果. df = pandas.read_excel("/you
import os filepaths = []; dirpaths = []; pathName = r'C:\anfei\json\20191128' for root, dirs, files in os.walk(pathName): for file in files: file_path = os.path.join(root, file) filepaths.append(file_path) for dir in dirs: dir_path = os.path.join(roo