我有2个存储桶,其中包含以下文件:
freedom-meital3
\text4
\text5
freedom-meital2
\text5
\text4
我只想在密钥相同的情况下比较etag。我弄错语法了。问题在于:if key['Key'] == key2['Key']
conn = client('s3') # again assumes boto.cfg setup, assume AWS S3
for key2 in conn.list_objects(Bucket='freedom-meital3')['Contents']:
for key in conn.list_objects(Bucket='freedom-meital2')['Contents']:
print(key2['Key'])
print(key['Key'])
if key['Key'] == key2['Key']
当
if
语句的计算结果为true时,您想做什么?这没有被处理,您在它后面也丢失了一个:
。可能是这样的:相关问题 更多 >
编程相关推荐