Install python--in Windows (Windows7)

Source: Internet
Author: User
Tags python script

First of all I am slightly angry to write this blog, the reason is very simple, when the online data are all ambiguous copy and paste without substantial help cause you repeatedly hit the wall, the blood will naturally a little surging.

Landlord actually just contact Python, this afternoon after reading the entry level of the first two chapters of "Python Primer", want to download to see, Google finished "Windows Python Installation", slightly dumbfounded, not from the environment variable start, that is similar to the way next down on the good. I am in the Foreign language web site to the information link to give a little more detail, convenient for readers is my csdn bo owners of the small purpose mody.

Okay, no more nonsense.

Download the Python installation package to the Python website www.python.org

I don't know how the others were installed, I only know that I entered the site, as the feeling of entering the daily, that is, the feeling of hemp (not bad foreign language, I new TOFEL97 points, IELTS 7 points), a vast expanse of where to find resources links, I believe this is also a lot of friends feel the same. My installation method is: Click on Windows in the left branch, go to the new page, have a alternative Packages for Windows. then there's a activestate ActivePython

Click it on the right, and then enter a new interface, the top has a large gray banner, point download button can be quietly waiting (specific link here: Http://www.activestate.com/activepython), about a forty or fifty m around , listen to a song and come back to it. After you're done, it's just a. msi file, double click, this time it's really all the way next down, that's all.

Do not be happy too early, you download installed Python, does not mean that you have been able to use, by default, the system will not add the appropriate environment variables, so at this time you use any Python commands on the command line is futile.

First you need to register the Python environment variable in your system: If Python's installation path is c:\python27, modify My Computer-> Properties-> Advanced-> environment variable-> system variable path is:

(To run the Python command in command-line mode, you need to attach the directory where the Python.exe resides to the environment variable of path.) )

Path=path;c:\python27 (These two words should be intact, remember)

Once the above environment variables are set successfully, you can use the Python command directly at the command line. Or execute Python *.py to run the Python script. Then enter the command line, Windows key +r, then cmd, enter the DOS interface, input python, and enter the Python language editor prompt. Knock on a print "blogger is Handsome", if there is a blogger is a handsome boy, you are complete, if not, Bo Master is still very handsome.

At this point, you can only run the Python script through Python *.py, and if you want to run the *.py directly, just modify another environment variable Pathext:

Pathext=pathext;. PY;. PYM

As for Senma with this kind of activestate installation method, the reader may wish to try a pilot to select the release on the left, choose a version of the next, after the matter, you later found that Chrysanthemum tight, is not the other, because the folder is more you at a loss, well, I admit that I am lazy, Technology is convenient, isn't it?

Also, in the process of using Python, you may need to review the help documentation for a command frequently, such as using the ' print ' to view the instructions for using the Print command. The default installed Python is not able to view the help document and requires a simple configuration:

In the Python installation directory, locate Python27.chm, use Hh-decompile. Python26.chm to decompile it, and then add its directory to the PATH environment variable mentioned above.

There is to import the default installation path of Third-party modules (such as their own written module), you need to create a new pythonpath environment variable, the variable value is the directory of this module.

I wish you all the technical level here should be applause ~


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.