小编pir*_*ing的帖子

Read .pptx file from s3

I try to open a .pptx from Amazon S3 and read it using the python-pptx library. This is the code:

from pptx import Presentation
import boto3
s3 = boto3.resource('s3')

obj=s3.Object('bucket','key')
body = obj.get()['Body']
prs=Presentation((body))
Run Code Online (Sandbox Code Playgroud)

It gives "AttributeError: 'StreamingBody' object has no attribute 'seek'". Shouldn't this work? How can I fix this? I also tried using read() on body first. Is there a solution without actually downloading the file?

python amazon-s3 boto3 python-pptx

5
推荐指数
1
解决办法
150
查看次数

标签 统计

amazon-s3 ×1

boto3 ×1

python ×1

python-pptx ×1