Zero basics Python (1) Python environment installation-Python tutorial

Source: Internet
Author: User
This is the first article in this series, so I started to talk about how to install the Python environment on LINUX, windows, and MAC systems, I hope it will be helpful to everyone. any advanced language requires a programming environment. this is like writing. it requires paper and pen to write things on the computer, you also need text processing software, such as OFFICE with various names. Pen, paper, and office software are the hardware or software used to write things. In short, the words can only be written on the top to become an article. So programming also requires something like a program. you need to write the program to it to form things like the article at last.

Now I have another term, "program". what is a program? This article will not be discussed. If the word is not very understandable to the audience, google it online.

Note: a very important learning method is recommended.

I am going to read the article's zero-based friends, or even non-zero-based friends. I don't want to learn many advanced python language skills here.

"Come on, do you think you're crazy ?"

None. It is important to learn some methods. For example, google surfing is a good learning method. The greatness of the Internet lies not only in playing games, watching eye-catching photos or various videos. of course, for a long time in a country, the Internet is equal to the entertainment network. I sincerely hope to start from my friends who read this article, the Internet is not just entertainment network, but also knowledge network and creative network. Pull it back. In the course of learning, if you encounter a little question, you should not let it go. after you think about it and try it, you should google it whether there are any results or not.

After reading the column, I wrote it clearly. it was google, not to let everyone use that degree to search, the search is dedicated to searching for gossip, fake medicines, and various pictures of frugal girls. If you really want to improve your technical vision and focus on technical issues, use google. Of course, I know that it is difficult for you to use it. as a technical person, you must learn the Internet technology.

What? Don't you understand? You are indeed my reader: zero base. Let me know, whether it's joining the QQ group or Weibo.
If you want to practice the power of your work, you can use your own tools. The power of God is a prerequisite.

To learn python, you do not need to learn it yourself. Python does not need to be so cruel, but it also requires installation of something for use.

All the things to be installed are on this page: www.python.org/downloads/

Www.python.org is the official website of python. if you use enough English, you can read it here and get a lot of results.
On the python download page, there are two types of python: python3.x. x and python2.7.x. It can be said that python3 is the future, and it is better than python2.7. However, there are still many other things that are not fully compatible with python3. What's more, if you have learned python2.7, for python3, it is only a small change in some places.

So here I will use python2.7 as an example to teach.

Linux installation

What operating system does the official computer use? Understand it first. If it is a Linux release, it will be the same as me. And I congratulate you, because more python libraries (modules) will be installed in the future. in this kind of operating system, the operation is very simple. of course, if it is iOS, it will also be the same, because they are all UNIX eggs. However, widows is a little different.

But it doesn't matter. python is cross-platform.

Taking ubutu 12.04 as an example, all the friends who use this operating system (certainly few) will enter python in shell. if you see >>>, the python version information is displayed. congratulations, because your system already has a python environment. Indeed, ubuntu has a built-in python environment.

I have to install it myself. Then, perform the following operations:

# Download the source code. The latest version is 2.7.8. if you change it later, you can change the version number in the following command # The source code can also be downloaded from the website, for details, see the preceding download page wget http://www.python.org/ftp/python/2.7.8/python-2.7.8.tgz?decompress source code package tar-zxvf Python-2.7.8.tgz # compile cd Python-2.7.8. /configure -- prefix =/usr/local # specifies the directory make & make install

The above steps are obtained from the internet for your reference. Because my machine has been installed for a long time and I don't want to worry about it. After installation, go to shell and enter python. The following figure is displayed:

qw@qw-Latitude-E4300:~$ pythonPython 2.7.6 (default, Nov 13 2013, 19:24:16) [GCC 4.6.3] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> 

Congratulations! the installation is successful. I use python2.7.6. maybe your version is higher.

Windows installation

Find the windows installation package on the download page, download it, for example, download this file: python-2.7.8.msi. Next, we will continue to "next" to complete the installation.

Note: After installation, check whether python exists in the environment variables.

If you do not know what windows environment variables are and how to set them. Don't worry, please google it and search: "windows environment variable" to find out how to set it.
After the preceding steps are completed, input python in cmd to get the result similar to the preceding one. it means that the installation is complete.

Installation of Mac OS X

In fact, there is no need to write about how to install it, because a friend of Mac OS X must be a master of the master, at least I have always admired those who use Mac OS X and insist on not switching to windows. You may need to search for Mac OS X on the Internet, which is similar to the previous unbutu.

If the installation is successful successfully using the above method, it can only be noted that it is lucky. If the installation is not successful, this is an excellent opportunity to improve your own, because only when you encounter problems can you solve the problem, in order to know more profound truth, do not be afraid, there are google, it can help column administrators solve all problems. Of course, you can join the QQ group or ask me via Weibo.

OK! After installation, you can start programming immediately. Finally, I shouted a slogan I saw in a programming video course advertisement. it was very enlightening: "We programmers don't want to pass it, but they want to report an error ".

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.