Google App Engine, How to make native file object?

前端 未结 2 797
终归单人心
终归单人心 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条回答
  •  -上瘾入骨i
    2021-01-25 02:26

    You can use python's StringIO class to wrap a a file-like object around any data retrieved by URL Fetch.

    If you use python's urllib2.urlopen() instead of Google's URL Fetch API, you'll get a file-like object which might work with your library.

提交回复
热议问题