转自:http://blog.sina.com.cn/s/blog_5a81b79901015sf9.html
在win7下面使用PIL中Image的show()函数时,执行下列代码:
from PIL import Image
img = Image.open("G:\\1.png")
img.show()
发现图片不能够正常的显示,windows自带的图片查看器显示图片内容不存在。
解决方法:(X为python的安装盘符)
X:\Python26\lib\site-packages\PIL\ImageShow.py, 第99行替换为:
return "start /wait %s && PING 127.0.0.1 -n 5 > NUL && del /f %s" % (file, file)
原因见此网址(8楼):
www.velocityreviews.com/forums/t707158-python-pil-and-vista-windows-7-show-not-working.html