开发者

Receiving email with .csv attachment with google app engine

I have been able to read em开发者_StackOverflow社区ails, and I can see the attachments, but they don't come in as .csv data. I guess it is an 'EncodedPayload' type?

The following code:

for filename, content in attachments:
    logging.info("filename: " + filename)
    fileReader = csv.reader(content.split("\n"))

gave me this error:

'EncodedPayload' object has no attribute 'split'

How do I parse a csv file given an EncodedPayload ?


call decode() on your content:

fileReader = csv.reader(content.decode())
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜