我需要在python中读取_csv文件,哪个文件在 UPLOAD_FOLDER
FileNotFoundError: [Errno 2] File b'../bpe.csv' does not exist:
这是代码:
def get_uploads():
"""gets the images and other files from the uploads directory
and returns two lists of tuples in the form (name, path)
"""
others = []
uploads = os.listdir(os.path.join(app.root_path, app.config['UPLOAD_FOLDER']))
# sort by time last modified
uploads.sort(key=lambda filename: os.stat(os.path.join(app.root_path, app.config['UPLOAD_FOLDER'], filename)).st_mtime)
for upload in uploads[::-1]:
others.append(( upload))
print(others)
for i in others:
if i=='bpe.csv':
databpe=i
if i=='ch.csv':
datach=i
if databpe and datach:
df=pandas.read_csv(databpe)
ch=pandas.read_csv(datach)
flash("check desktop","success")
return render_template("page3.html")
catspeake
相关分类