A graphic tutorial on building a Python Web environment in Windows 7,

Source: Internet
Author: User

A graphic tutorial on building a Python Web environment in Windows 7,

Recently I want to try to create a Web application using Python on IBM Bluemix, so I need to build a Python Web development and testing environment locally.

Python version

Go to the Python website and move the mouse over the navigation bar to download. We will find two download links for the main version!


What is the difference between the two?

Personally, 2.7.x is a more stable version, while 3.x is a more advanced version, including many new features and features;

But if you want to develop a new project using Python, how do you select the Python version? Most Python libraries support Python 2.7.x and 3.x at the same time. Therefore, you can select any version.

But there are some differences that need attention. For details, refer to the important differences between Python 2.7.x and 3.x.

Download Python

If no version is specified in Bluemix, V2.7.10 is selected by default. Therefore, I decided to download and install V2.7.10.

My operating system is Windows 7 64-bit, so you need to download the 64-bit installation package; click to enter the Python download page;


Install Python

Run the downloaded installation package



Add python.exe to path (Add Python to Path environment variable) must be selected! Otherwise, the problem shown in the following figure will occur;



Installing


During this period, a Dos window may pop up and will be closed soon;



Now the installation is complete. Open the command line, enter "Python", and press enter to check it!


Pip

Pip is a tool for installing and managing Python packages. It is a replacement of easy_install.

I have seen some articles on the Internet that Pip still needs to be installed independently. It is out of date. After the above steps, Pip has been installed;

About Python IDE

What is IDE?

IDE = integrated development environment = integrate various development-related environments (and tools)

Python IDE = Python integrated development environment = various tools related to Python Development

In the "Start Menu" program "Python 2.7, you can see the following menu:


The interface is as follows:

However, the command lines provided by Python are not easy to use, because they cannot be used to repeat previous commands through the up/down key.


Local Document Service:


Hello World


Paste the following code:

#!/usr/bin/python # -*- coding: UTF-8 -*-  print 'hello world'  for i in range(1,5):  for j in range(1,5):   for k in range(1,5):    if( i != k ) and (i != j) and (j != k):     print 'hello world', i,j,k 

Save the file and run the following command to view the result:


The output result is as follows:


You can also execute it in the command line, for example:


Summary

Now the Python Web development environment has been set up, which is very simple!

Some friends may be angry. I haven't seen the Web shadow yet!

Haha, I just discovered that, like the Go language, the Web server can write Python on its own;

To be continued ......

Next article: getting started with Python: The first Python Web program-a simple Web Server

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.