path = r'C:\Users\Administrator\Desktop\处理完成的excel' # 目录(放Excel表格的目录) xcels = [pd.read_excel(path + "\\" + fname) for fname in os.listdir(path) if "6001" in fname] df = pd.concat(xcels) df.to_excel(r'C:\Users\Administrator\Desktop\处理完成的excel\合并完成的excel.xlsx', index=False)