简体   繁体   English

使用 Python 移动 Dropbox 智能同步文件/文件夹

[英]Move Dropbox Smart Synced Files/Folders using Python

If you set Dropbox Smart Sync to online-only for a folder or file, you can still see the file or folder on your computer, but it's just a placeholder.如果您将文件夹或文件的 Dropbox Smart Sync 设置为仅在线,您仍然可以在计算机上看到该文件或文件夹,但它只是一个占位符。

I can manually move or copy the files as normal.我可以像往常一样手动移动或复制文件。 But the problem is when I use Python to move the files (still within Dropbox), it will have to wait for the files to finish downloading and then move.但问题是当我使用 Python 移动文件(仍在 Dropbox 中)时,它必须等待文件完成下载然后移动。

I'm using "move" from shutil.我正在使用shutil的“移动”。

Is there any other way to avoid this issue?有没有其他方法可以避免这个问题?

You could use the Dropbox API to issue the commands to the Dropbox servers directly, instead of to your local filesystem:您可以使用 Dropbox API 直接向 Dropbox 服务器发出命令,而不是向本地文件系统发出命令:

https://www.dropbox.com/developers https://www.dropbox.com/developers

There's an official Dropbox Python SDK here:这里有一个官方的 Dropbox Python SDK:

https://github.com/dropbox/dropbox-sdk-python https://github.com/dropbox/dropbox-sdk-python

You can use that to copy and move files (among other operations):您可以使用它来复制和移动文件(以及其他操作):

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM