【发布时间】:2023-03-13 22:05:01
【问题描述】:
我正在尝试列出 S3 中子目录下的文件,但我无法列出文件名:
import boto
from boto.s3.connection import S3Connection
access=''
secret=''
conn=S3Connection(access,secret)
bucket1=conn.get_bucket('bucket-name')
prefix='sub -directory -path'
print bucket1.list(prefix)
files_list=bucket1.list(prefix,delimiter='/')
print files_list
for files in files_list:
print files.name
你能帮我解决这个问题吗?
【问题讨论】:
标签: python amazon-web-services amazon-s3 boto