您可以考虑使用
io.BytesIO的前向兼容。
Python 3中不存在StringIO和cStringIO模块。
from PIL import Imageimport urllib2 as urllibimport iofd = urllib.urlopen("http://a/b/c")image_file = io.BytesIO(fd.read())im = Image.open(image_file)
欢迎分享,转载请注明来源:内存溢出
您可以考虑使用
io.BytesIO的前向兼容。
from PIL import Imageimport urllib2 as urllibimport iofd = urllib.urlopen("http://a/b/c")image_file = io.BytesIO(fd.read())im = Image.open(image_file)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)