Install Python on MS Windows 7
今天开始,笔者打算了解下Python这门编程语言。
为了较为快速的上手,本文将在MS Windows 7的操作系统上部署Python的开发环境。
下面开始。
————————————————————————
Python的官方网站为:http://www.python.org
目前,Python的最新版为:2.7.9和3.4.2。
它们的下载链接如下所示:
for MS Windows:
https://www.python.org/ftp/python/2.7.9/python-2.7.9.msi
https://www.python.org/ftp/python/3.4.2/python-3.4.2.msi
在MS Windows下,安装都是图形化的,没有太多可以说的内容,具体如下列截图所示:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! >>> |
如果希望在MS Windows的任意命令窗口中调用Python,需要添加Python到操作系统环境变量:%PATH%中,如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
C:\Users\adamhuan>echo %PATH% E:\Python27\;E:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Wi ndows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files \TortoiseSVN\bin C:\Users\adamhuan>python Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> quit() C:\Users\adamhuan> |
——————————————————————
Done:2015年1月26日22:05:24