Open the path to Python learning

Source: Internet
Author: User

Freshman enrollment this week, basically are looking at Python from the beginner to proficient, while reading the code, a few simple lines of code, to consolidate the knowledge, like learning all kinds of programming language, from the initial development environment of the building, data types, learning to take notes, and then learn to use.

Learning directory:

Chapter One: Construction of the environment

Whether you are pretending to be a python2.7 or a python3.0, there is no difference in use, but there are slight changes, such as when the file read the exception in the back of the operation, want to catch the exception of the file does not exist, in the 2.7 version of the use of the IOError exception, and in the 3.0 version of the FILENOTF Ounderror exceptions, mixed use is definitely not allowed.

I'm loading version 2.7, code example:

1filename ='Programming.txt'2 3 Try:4 With open (filename) as File_object:5Contents =File_object.read ()6 exceptIOError:7     Print("file is not found")8 Else:9     Print(contents)

In the environment of the building, the installation path to choose the folder C Python27, represents the 2.7 version, and then all the way next to complete the installation, but to pay particular attention to the configuration of the environment variable, after you install the python2.7, you want to open the system environment variable path, in the inside add c \ python27\; C:\Python27\Scripts; two variable values, then it's done.

In fact, this configuration is similar to the configuration of the Java environment, familiar with the configuration of Java and other environments is very simple.

Turn on CMD to verify that the configuration is successful:

  

That means it's a success! Then install a text editor on the line, I use the Geany client, everywhere can be downloaded to, the icon is an "Allah light God Ding", joking!

Well, the first chapter is these, the back will continue to take notes!

  

  

Open the path to Python learning

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.