Introduction to "Python①" Python, Installation and configuration

Source: Internet
Author: User

  Start learning python today and keep a record of some of your ideas and knowledge, such as omissions or expressing questions, and you are welcome to correct yourself. All subsequent code is written for the Python 3.3.2 version (Run Environment: WINDOWS7).

  Attached: August 2014 Tiobe programming language rankings

Python:https://www.python.org/downloads/(currently updated to 3.4.1/2.7.8)

About Python

Python, an object-oriented, interpretive computer programming language, was invented by Guido van Rossum at the end of 1989 and the first public release was released in 1991. Python syntax is concise and clear, with a rich and powerful class library, often nicknamed the glue language. Its syntax is simple and clear, as far as possible the use of non-semantic English words, unlike most other programming languages using curly braces, it uses indentation to define the block of statements.

Python's design philosophy is "elegant", "clear", "simple". So the idea that "there are always multiple ways to do the same thing" in the Perl language of its opponents is often intolerable in Python developers. The Python developer's philosophy is "in one way, it's best to have only one way to do something." When designing the Python language, Python developers tend to reject the fancy syntax when faced with a variety of choices, and choose a syntax that is unambiguous or rarely ambiguous. Because of this conceptual difference, Python source code is often thought to be more readable than Perl and can support large-scale software development. These guidelines are called "python maxims ." Running import this within the Python interpreter gives you a complete list.

>>>Importthisthe Zen of Python, by Tim petersbeautiful isbetter than ugly. Explicit isbetter than implicit. Simple isBetter than Complex.complex isbetter than complicated. Flat isbetter than nested. Sparse isbetter than dense. Readability counts. Special cases aren'T special enough to break the rules.Although practicality beats purity. Errors should neverPasssilently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- andPreferably only one--obvious-do it. Although that, may notBe obvious at first unless're Dutch.Now isbetter than never. Although never isOften better than *right*Now . If the implementation isHard to explain, it's a bad idea.If the implementation isEasy to explain, it is a good idea. Namespaces is one honking great idea-Let's do more than those!>>>

2.x or 3.x

Currently, Python has two versions, One is version 2.x, one is the 3.x version, these two versions are incompatible, because Python is now evolving towards the 3.x version, in the process of evolution, a large number of 2.x version of the code to be modified before it can be run, so there are many third-party libraries are temporarily unable to use on the 3.x.

The author selected 3. X version to learn.

Environment variable Configuration

This is because Windows will find the Python.exe according to the path set by the environment variable of path, if not found, it will be an error. The workaround is to add the path D:\Program Files (x86) \python 3.3.2 to path where the Python.exe is located. Right click on the properties on the desktop computer, click on "Advanced system Settings", "Environment variables", open the "Environment variables" window, in the system variables, find the "Path" variable, and then click "Edit":

In the "Edit System Variables" window, you can see that the variable name is path, at the end of the variable value, first add a semicolon ";" (Note using the English input method, do not enter a Chinese semicolon), and then write on D:\Program Files (x86) \python 3.3.2 ( your Python installation directory ), and then continuous point "OK."

Then open cmd and enter Python to test.

  

When you see the above picture, the Python configuration is successful and exit() you can exit the Python environment by entering enter.

Summary of the day

Introduction to Python, how to install on Windows, configure, enter to exit the Python interactive environment.

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.