0 Basics Python (i) Python environment installation _python

Source: Internet
Author: User

Any high-level language needs a programming environment of its own, which is like writing, needing paper and pens, writing on a computer, and having word processing software, such as office with various names. Pen and paper and office software, is the hardware or software to write things, in short, those words can only be written on that top, in order to finally become an article. So programming is also, what kind of program to have something, to write the program to the top, in order to form the last thing like the article.

Just now there is a term--"program", What is a program? This article will not talk about it. If listed as the audience is not very understanding of this word, please go online Google.

Note: Recommend a very important learning method

I am here to read the article 0 Basic friends, and not 0 basic friends, do not want to learn a lot of advanced Python language skills here.

"Rely on, then see you nonsense?" ”

Not too. It is important to learn some methods. For example, just to recommend the "internet Google", is very good learning methods. The great thing about the internet is not just playing games, seeing eye-pleasing photos or all kinds of videos, of course, in a country for a long time the internet equals the entertainment network, I sincerely hope to start with the Friends reading this article, the Internet is not only entertainment network, or knowledge network and create network. Pull it away, draw it back. In the learning process, if you encounter a little doubt, do not let go, think about it, after a try, no matter whether there is no result, but also to Google.

Listed as optimistic, I wrote it very clearly, is Google, not let everyone to use that degree to search, the search is dedicated to search for gossip, counterfeit, and a variety of very frugal girl photos. If you really want to improve your technical horizons and focus on technical issues, please use Google. Of course, I know you are in use when the time is difficult, as a to be a bit of technical achievements of the people, must learn a little internet technology, you know.

What the? You don't understand? You are indeed my reader: 0 foundations. Then specifically to ask me, whether to join the QQ group or Micro Bo, can be.
To practice martial, brandished from the palace. Magic is a prerequisite.

To learn python, you don't have to be in the palace. Python doesn't have to be brutal, but it needs to be installed.

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

Www.python.org is the official Python website, if your English is enough to use, then you read here, you can get a lot of harvest.
In the Python download page, it shows that Python currently has two broad categories, one is python3.x.x, the other is python2.7.x. It can be said that Python3 is the future, it is more progress than python2.7. But now, there are many things that are not fully compatible with Python3. What's more, if you learn python2.7, for Python3, it is only a small change in some places.

Therefore, I am here to use python2.7 as an example to teach.

Installation of Linux Systems

What is the operating system of the computer used by reader? I understand it first. If it's a Linux distribution, it's my fellow. And I congratulate you, because there will be more Python libraries (modules) in the future, under this operating system, the operation is very simple, of course, if it is iOS, the same, because all are the eggs under UNIX. It's just widows a little unorthodox.

But that's okay, Python is cross-platform.

I take Ubutu 12.04 as an example, all friends with this operating system (certainly very few), you will certainly enter Python in the shell, if you see >>>, and display the Python version information, congratulations, Because your system has already brought the Python environment into its own. Indeed, Ubuntu has a built-in Python environment.

I have to install it myself. So operate it:

#下载源码, the latest version is 2.7.8, if you change later, you can change the version number in the following command
#源码也可以在网站上下载, see the above download page
wget http://www.python.org/ftp/python/ 2.7.8/python-2.7.8.tgz

#解压源码包
tar-zxvf python-2.7.8.tgz

#编译
cd Python-2.7.8
./configure-- Prefix=/usr/local  #指定了目录
make&&make Install

The above steps, I found from the Internet, for reference. Because my machine is already installed, do not want to toss. Once installed, enter the shell and enter Python and you will see the following:

qw@qw-latitude-e4300:~$ python
python 2.7.6 (default, Nov 2013, 19:24:16) 
[GCC 4.6.3] on linux2
Type "h ELP "," copyright "," credits "or" license "for the more information.
>>> 

Congratulations, the installation was successful. I'm using python2.7.6, maybe your version number is higher.

Installation of Windows system

To the download page to find the Windows Installer package, download, such as downloading the file: Python-2.7.8.msi. Then there is the continuous "next step" to complete the installation.

Note that after installation, you need to check to see if the environment variable has python.

If you don't know what Windows environment variables are, and how to set them. Do not worry, please Google, search: "Windows environment variables" can find out how to set up.
Above all, in cmd, input python, get similar to the above results, it is already installed.

Installation of MAC OS x system

In fact, there is no need to write how to install, because with the Mac OS X friend, is certainly a master of the high master, at least I have always admired those with Mac OS X and insisted on not replacing windows. Trouble with Mac OS X Friends of their own online search, with the front Unbutu almost.

If according to the above method, successful installation success, can only explain the lucky, without it. If the installation is not successful, this is an excellent opportunity to improve themselves, because only the problem to solve the problem, to know more profound truth, do not be afraid, there is Google, it can help list reader solve all problems. Of course, join QQ group or through Weibo, ask me also can.

Once the ok! has been installed, it's ready to start programming. Finally shout a sentence in a programming video course ads see the slogan, very enlightening: "We programmers, do not seek to pass, but for the 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.