1:为了识别验证码,首先必须学习下python的图形处理
import Image
im = Image.open("F:\\captcha.jpg")
print im.mode, im.size, im.format
结果:
RGB (250, 40) JPEG
rgb是颜色的 第二个是像素 第三个是格式
im.show是看不到图片的,不知道为什么?看网上的解决是:
Here is a quick workaround:
Edit C:\Python26\lib\site-packages\PIL\ImageShow.py, and around line 99, replace with the following line:
return "start /wait %s && PING 127.0.0.1 -n 5 > NUL && del /f %s" % (file, file)
但是还是没用,可能我的python版本不是2.6的。
现在可以成功了,im.show()可以用