Google App Engine, How to make native file object?

前端 未结 2 842
终归单人心
终归单人心 2021-01-25 02:16

I\'m trying to convert some data got from urlfetch to native python file object. Does anyone know how to do this?

I understand GAE can\'t save files to local. But I need

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-25 02:40

    If you just need a file-like object, you can use urllib2, which on GAE is a wrapper around urlfetch. urlopen returns the file-like object. I don't know of a way you could get a true file handle for a downloaded URL.

提交回复
热议问题