Grayscale
#Coding:utf8ImportReImportUrllibImportUrllib2ImportRequests fromPILImportImageImportNumPy as NPdefDownloads_pic (* *kwargs): Pic_name= Kwargs.get ('Pic_name', None) URL='http://www.xxx.com/code.do'Res= Requests.get (url, stream=True) with open (pic_path+'test11.bmp','WB') as F: forChunkinchRes.iter_content (chunk_size=1024): ifChunk#filter out keep-alive new chunksf.write (chunk) f.flush () f.close () pic_path='tmp\\'downloads_pic () Image= Image.open ('tmp\\test.bmp')#image.show () #显示图片Imgry = Image.convert ('L')#convert to grayscale figure 1: background black and white
From PIL import Image
Import NumPy as NP
Install NumPy
https://pypi.python.org/packages/2c/93/9556d25b1f23fd852fc2ddfcf68a4a62ba9e4ef83adabbf8921c80fce9a0/ numpy-1.11.3-cp27-none-win_amd64.whl#md5=33bfb4c5f5608d3966a6600fa3d7623c
python-m Pip Install--upgrade pip
Pip Install--user numpy scipy matplotlib ipython jupyter pandas SymPy Nose
Mark
Http://www.cnblogs.com/yinxiangnan-charles/p/5928689.html
Http://www.cnblogs.com/beer/p/5672678.html
http://blog.csdn.net/qq_30490125/article/details/51445390
Python Verification Code Test