且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用python和boto3检查S3存储桶中是否存在特定目录

更新时间:2023-11-27 08:58:34

请尝试以下代码

folders = bucket.list("","/")
for folder in folders:
    print (folder.name)

PS 参考 URL(如何使用 python 脚本将文件从一个存储桶复制到 Amazon S3 上的另一个存储桶)

PS reference URL(How to use python script to copy files from one bucket to another bucket at the Amazon S3 with boto)