Python Verification Code Test

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.