示例代码
import boto3
glacier = boto3.resource('glacier')
job = glacier.Job(accountID, vaultlist[0], id=joblist[0])
r = job.get_output()
print(r0['body'])
那印刷品只能生产botocore.response.StreamingBody在0xsnip
r0['body']应该是CSV格式的库存,但是我不知道如何才能得到它。我花了一点时间试着在蒸汽中阅读,要么这样做不对,要么我做错了。你能给我指出正确的方向吗?在
谢谢!在
这里有一个对我有用的解决方案,它可以将一个显示为StreamingBody的冰川档案保存到一个文件中。尤其是mp3文件。在
好吧,我根本找不到其他的工作方式,我敢肯定我自己缺乏技能。但是我可以使用httpget将清单下载到一个文件中。我就是这样做的。你会看到很多我有两个保险库,每个都有一个作业,你可以修改这个并以其他方式循环,或者如果你有一个保险库和一个作业,你可以对这两个列表使用[0],但重要的部分是我修改的Amazon EC2示例,我修改了它以从完成的冰川作业中检索库存。在
我知道我的代码写得不是很好,但它满足了我的一次性需求。 希望这对其他人有帮助。在
相关问题 更多 >
编程相关推荐