需求:数据库导出数据,需要查询某一个时间内,指定用户的全部信息,不能使用插件(pandas)
1、遍历输出
import os
def eachFile(filepath):
pathDir =os.listdir(filepath) #遍历文件夹中的text
return pathDir
def readfile(name):
fopen=open(name,'r')
for lines in fopen.readlines():
lines = lines.replace("\n", "").split(",")
if 'aaa' in str(lines) and '2' not in str(lines):
print(lines)
fopen.close()
filePath = "\home\jun\data"
pathDir=eachFile(filePath)
for a