Python computer visual code and python visual code

Source: Internet
Author: User

Python computer visual code and python visual code

 

Before you begin, explain the development environment. My personal experience is that, due to version compatibility problems, learning Python often encounters Inexplicable phenomena.

Environment:

Win7 Professional Edition 64-bit Python 2.7.14Ipython 5.5.0pip 9.0.1matplotlib 2.1.0numpy 1.13.3PIL 1.1.7Pillow 4.3.0

 

The following code is available for test.

1 from numpy import * 2 from pylab import * 3 from PIL import Image 4 5 # Load local images, beware of Chinese characters 6 im = array (Image. open (unicode ("f: \ Desktop \ test.jpg", 'utf-8') 7 imshow (im) 8 9 10 x = [100,100,300,300] 11 y = [200,300,200,300] 12 13 # Draw points and lines on the image 14 plot (x, y, 'r *') 15 plot (x [: 2], y [: 2]) 16 17 # title and coordinate axis 18 title (unicode ("dark knight", 'utf-8 ')) 19 axis ('off') 20 21 show ()

 

 

 

 

Before making the above Code work properly, I encountered some problems and recorded the following for reference:

Q: How to check the installed python software package and Version A: pip listQ: how to install matplotlibA: python-mpip install-U matplotlib see http://matplotlib.org/users/installing.htmlQ: name array is not definedA: from numpy import * Q: When the imshow () function is used, the prompt PIL Image data can not convert to floatA: python-mpip install pillow is displayed.

 

Related Article

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.