#读csv,excel,json数据 with open('E:\\test\\xdd.csv','r') as f: for line in f.readlines(): print(line) import pandas df = pandas.read_csv('E:\\test\\xdd.csv') print(df) import pandas df = pandas.read_excel('E:\\test\\aa.xls') print(df) import json with o…
# -*- coding: utf-8 -*- import math import re import csv import repr def ean_checksum(eancode): """returns the checksum of an ean string of length 13, returns -1 if the string has the wrong length""" if len(eancode) != 13: re…
# coding=gbk import os import os.path #读取目录下的所有文件,包括嵌套的文件夹 def GetFileList(dir, fileList): newDir = dir if os.path.isfile(dir): fileList.append(dir) elif os.path.isdir(dir): for s in os.listdir(dir): # 如果需要忽略某些文件夹,使用以下代码 # if s == "xxx": # con…