dropbox - 如何减少在 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)
解决方案
推荐阅读
- python - 具有 nans 的数据框列的移动平均值
- r - 在 Windows 上安装 addmtoolbox:x 不是 data.table (RStudio)
- django - 在 Django 上更新数据库
- django - 使用 Django,SimpleJWT 检查用户显示内容的权限属于他自己的公司
- amazon-web-services - 按下提交按钮时如何触发从 Flutter 表单获取输入的 AWS Lambda 函数
- ansible - 如何将 ansible playbook 作为 cron 作业运行?
- r - 堆叠的 geom_bar(),每个 x 值有 2 个柱
- python - 如何使我的播放器类中的更新函数通过动画的索引移动
- android - RecaptchaActivity 上的 Android Firebase-auth 崩溃
- python - 并行读取和处理多个文件