首页 > 解决方案 > 如何减少在 Python 中将许多文件上传到 Dropbox 的执行时间?

问题描述

我的文件夹中有 100 个文件 (.csv),我想将这些文件上传到 Dropbox。我已经使用以下代码成功完成了此操作,但问题是执行时间需要很长时间。所以我的问题是:如何减少在 Python 中将这些文件上传到 Dropbox 的执行时间。带着我的感谢和赞赏

dbx = dropbox.Dropbox('Access token')
filename = (os.listdir('path'))
for fn in filename:
    with open(fn, 'rb') as f:
        dbx.files_upload(f.read(), '/sendTOcloud/' + fn + '.csv', mute=True)

标签: dropbox

解决方案


推荐阅读