os.path.splitext(file_name)[1] in ['.后缀'] 例如:os.path.splitext(D:/app/str.csv)[1] in ['.xls']判断文件格式是否为xls