python程序安装方法-python简介及详细安装方法

1.Python简介

1.1 Python是什么

相信混迹IT界的很多朋友都知道,Python是近年来最火的一个热点,没有之一。从性质上来讲它和我们熟知的C、java、php等没有什么本质的区别,也是一种开发语言,而且已经进阶到主流的二十多种开发语言的top 5(数据源自最新的TIOBE排行榜)。

1.2 Python的由来和发展趋势

Python的前世源自鼻祖"龟叔”。1989年,吉多·范罗苏姆(Guido van Rossum)在阿姆斯特丹为了打发无聊的圣诞节,决心开发一个新的脚本解释程序,自此Python和创始人"龟叔”开始进入公众视野。他希望这个新的叫做Python的语言,能符合他的理想:创造一种C和shell之间,功能全面,易学易用,可拓展的语言。

1991年,第一个Python编译器诞生。它基于C语言实现,并能够调用C语言的库文件。后面历经版本的不断换代革新,Python走到了非常具有里程碑意义的一个节点,即2004的2.4版本诞生了目前最流行的WEB框架Django!六年后Python发展到2.7版本,这是目前为止2.x版本中最新且较为广泛使用版本。

2.7版本的诞生不同于以往2.x版本的垂直换代逻辑,它是2.x版本和3.x版本之间过渡的一个桥梁,以便最大程度上继承3.x版本的新特性,同时尽量保持对2.x的兼容性。

因此3.x版本在2.7版本之前就已经问世,从2008年的3.0版本开始,python3.x系呈迅猛发展之势,版本更新活跃,一直发展到现在最新的3.5.2版本。3.5版本也是目前3.x系列中主流且广泛使用的版本,后续相关程序的demo,默认均基于3.5版本展开。

1.3 Python 2 VS Python 3

许多初学者会纠结于从2.x版本还是3.x版本开始python学习之路。这里简要对比下个人学习了解到的两者的差异:

3.x版本中 PRINT IS A FUNCTION,使用起来更简单方便;

3.x版本中默认使用unicode编码,妈妈再也不用担心你的程序编码问题了;

3.x版本中某些库进行了改名,具体还有待在后续学习中深入展开;

目前3.x版本还不能完全支持Twisted module,这恐怕是3.x版本中最大的遗憾。也不要过于纠结这点,据说官方正在弥补这个不足,同时也相信能有办法解决的:)

In summary : Python 2.x is legacy, Python 3.x is the present and future of the language. 长江后浪推前浪,python的未来是属于3.x系列的,官方宣布2020年之后不再支持2.x系列中最nb的2.7版本,2.x版本将逐渐寿终正寝,最终被铭刻在开发语言的丰碑上。

所以学习3.x版本没错的!

1.4 Python的优缺点

二十多种主流开发语言,python何以能在20多年间以如此迅猛之势横扫七大洲八大洋呢?这都是它自身优良的特性决定的.

Python优点:

1."优雅”、"明确”、"简单”

这是python的定位,使得python程序看上去简单易懂,初学者容易入门,学习成本更低。但随着学习的不但深入,python一样可以满足胜任复杂场景的开发需求。引用一个说法,Python的哲学是就是简单优雅,尽量写容易看明白的代码,尽量写少的代码。

2. 开发效率高

python作为一种高级语言,具有丰富的第三方库,官方库中也有相应的功能模块支持,覆盖了网络、文件、GUI、数据库、文本等大量内容。因此开发者无需事必躬亲,遇到主流的功能需求时可以直接调用,在基础库的基础上施展拳脚,可以节省你很多功力和时间成本,大大降低开发周期。

3. 无需关注底层细节

Python作为一种高级开发语言,在编程时无需关注底层细节(如内存管理等)。

4. 功能强大

Python是一种前端后端通吃的综合性语言,功能强大,php能胜任的角色它都能做,至于后端如何胜任,需要在后续学习中逐步领悟。

5. 可移植性

Python可以在多种主流的平台上运行,开发程序时只要绕开对系统平台的依赖性,则可以在无需修改的前提下运行在多种系统平台上,具体有待后续学习中深入展开。其他优点有待继续发掘。

一个硬币总有两面,那么Python有缺点吗?答案是肯定的,总结如下:

Python缺点:

1. 代码运行速度慢

因为Python是一种高级开发语言,不像c语言一样可以深入底层硬件最大程度上挖掘榨取硬件的性能,因此它的运行速度要远远慢于c语言。另外一个原因是,Python是解释型语言,你的代码在执行时会一行一行地翻译成CPU能理解的机器码,这个翻译过程非常耗时,所以很慢。而C程序是运行前直接编译成CPU能执行的机器码,所以非常快。

但需要注意的是,这种慢对于不需要追求硬件高性能的应用场合来讲根本不是问题,因为它们比较的数量级根本不是用户能直观感受到的!想想程序执行所需的时间数量级?例如开发一个下载MP3的网络应用程序,C程序的运行时间需要0.001秒,而Python程序的运行时间需要0.1秒,慢了100倍,但由于网络更慢,需要等待1秒,用户体验几乎没有差别,除非你用非常精确的计时器来计时。

2. 发布程序时必须公开源代码

什么?有没有搞错?是的,发布程序时我们必须公开源代码!还是因为Python是一种解释性语言,没有编译打包的过程(据说最新的python可以打包,但本质上还是把源代码和解释器打在一起,没有太大实际意义)。想想我们的shell脚本是不是也是这个情况,你能在不发布源代码的情况下发布一个黑盒子程序来让别人正常使用么?

这个缺点仅限于你想单纯靠卖开发出来的软件产品挣钱的时候。但在这个开发互联的时代,不靠卖产品本身来赚钱的商业模式越来越主流了,所以问题也不是没法解决。

总结起来,Python的优点多于缺点,而且缺点在多数它能胜任的情况下不是根本性问题,瑕不掩瑜,尽情享受它给我们带来的乐趣和便利吧!

1.5 Python的适用领域

Python典型的适用领域如下:

1. 云计算开发

云计算领域最火的语言,典型代表openstack。

2. web开发

众多优秀的web框架,众多优秀的大型web站点(Youtube,instagrm,豆瓣等)均基于python开发。

3. 系统运维

各种自动化工具的开发,CMDB、监控告警系统、堡垒机、配置管理&批量分发工具等均可以搞定。这是自己需要重点学习的领域。

4. 科学计算、人工智能

据网上了解用于围棋大战的谷歌阿发狗就使用了python开发(但估计只是部分而已)。

5. 图形GUI处理

暂时没多少体会,后续领悟吧。

6. 网络爬虫

不知道给网络爬虫单独归类是否合适,姑且这样吧。这年头网络爬虫无处不在,很多都是基于python开发,包括谷歌的爬虫。估计这是爬虫工程师的必备工具吧。

1.6 哪些地方在用Python

来几个鲜活的知名公司应用案例,以示敬意:

谷歌:Google app engine、google earth、爬虫、广告等

Youtube: 世界最大的在线视频网站基于python开发,好强大

Instagram:美国最大的图片分享网站,全部基于python开发

facebook:大量的基础库基于python开发

Redhat:yum包管理工具基于python开发

国内知名互联网公司的应用:豆瓣、知乎的网站,还有很多主流的互联网公司(阿里、腾讯、百度、金山、搜狐、盛大、网易、新浪、网易、果壳、土豆等)通过python来完成各种任务

二.Python的安装

Python-3.7.0(32/64)位下载地址:

pan.baidu.com/s/1Ub89cbTjDm3GJg4ce2NKdQ

提取码:w614

被班上一个大佬安利后,发现了一个很实用的公众号,里面有几乎所有软件的详细下载方法,名字是软件安装管家,可以推荐大家关注一下,这个下载方法就是我搬运过来的,大家下载时候要注意自己电脑位数,不要下错了

选中【python-3.7.0】压缩包,鼠标右击选择【解压到python-3.7.0】。

1787792-20190907103248195-127330355.png

2.双击打开【python-3.7.0】文件夹。

1787792-20190907103357778-1441904602.png

3.在桌面鼠标右击我的电脑选择属性查看自己的电脑位数,64位系统选中【python-3.7.0.amd64】(32位系统就选择上面的)然后鼠标右击选择【以管理员身份运行】。

1787792-20190907103454353-1037544392.png

4.勾选【Add Python 3.7 to PATH】,然后点击【Customize installation】。

1787792-20190907103544478-1484592560.png

5.点击【Next】。

1787792-20190907103701780-1712382727.png

6.点击【Browse】更改软件的安装目录,建议在D盘或其他磁盘新建一个【Python37】文件夹,点击【Install】。

1787792-20190907103852607-1419342320.png

7.安装中。

1787792-20190907104015553-1290301020.png

8.安装完成,点击【Close】。

1787792-20190907104118353-78757909.png

9.在开始菜单栏找到并打开【IDLE (Python 3.7 64-bit)】。

1787792-20190907104159591-1121538106.png

10.安装完成。

第一次写博客啊,没经验,自己瞎琢磨,如果你已经看到这里,那你肯定是个很有思想的人,如果可以,希望能给我点个赞,,关系到我们平时成绩考核滴,谢谢啦

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
This is Python version 3.1.5 ============================ Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Python Software Foundation. All rights reserved. Python 3.x is a new version of the language, which is incompatible with the 2.x line of releases. The language is mostly the same, but many details, especially how built-in objects like dictionaries and strings work, have changed considerably, and a lot of deprecated features have finally been removed. Build Instructions ------------------ On Unix, Linux, BSD, OSX, and Cygwin: ./configure make make test sudo make install This will install Python as python3. You can pass many options to the configure script; run "./configure --help" to find out more. On OSX and Cygwin, the executable is called python.exe; elsewhere it's just python. On Mac OS X, if you have configured Python with --enable-framework, you should use "make frameworkinstall" to do the installation. Note that this installs the Python executable in a place that is not normally on your PATH, you may want to set up a symlink in /usr/local/bin. On Windows, see PCbuild/readme.txt. If you wish, you can create a subdirectory and invoke configure from there. For example: mkdir debug cd debug ../configure --with-pydebug make make test (This will fail if you *also* built at the top-level directory. You should do a "make clean" at the toplevel first.) What's New ---------- We try to have a comprehensive overview of the changes in the "What's New in Python 3.1" document, found at http://docs.python.org/3.1/whatsnew/3.1.html For a more detailed change log, read Misc/NEWS (though this file, too, is incomplete, and also doesn't list anything merged in from the 2.7 release under development). If you want to install multiple versions of Python see the section below entitled "Installing multiple versions". Documentation ------------- Documentation for Python 3.1 is online, updated twice a day: http://docs.python.org/3.1/ All documentation is also available online at the Python web site (http://docs.python.org/, see below). It is available online for occasional reference, or can be downloaded in many formats for faster access. The documentation is downloadable in HTML, PostScript, PDF, LaTeX (through 2.5), and reStructuredText (2.6+) formats; the LaTeX and reStructuredText versions are primarily for documentation authors, translators, and people with special formatting requirements. Converting From Python 2.x to 3.x --------------------------------- Python starting with 2.6 will contain features to help locating code that needs to be changed, such as optional warnings when deprecated features are used, and backported versions of certain key Python 3.x features. A source-to-source translation tool, "2to3", can take care of the mundane task of converting large amounts of source code. It is not a complete solution but is complemented by the deprecation warnings in 2.6. See http://docs.python.org/py3k/library/2to3.html for more information. Testing ------- To test the interpreter, type "make test" in the top-level directory. This runs the test set twice (once with no compiled files, once with the compiled files left by the previous test run). The test set produces some output. You can generally ignore the messages about skipped tests due to optional features which can't be imported. If a message is printed about a failed test or a traceback or core dump is produced, something is wrong. On some Linux systems (those that are not yet using glibc 6), test_strftime fails due to a non-standard implementation of strftime() in the C library. Please ignore this, or upgrade to glibc version 6. By default, tests are prevented from overusing resources like disk space and memory. To enable these tests, run "make testall". IMPORTANT: If the tests fail and you decide to mail a bug report, *don't* include the output of "make test". It is useless. Run the failing test manually, as follows: ./python Lib/test/regrtest.py -v test_whatever (substituting the top of the source tree for '.' if you built in a different directory). This runs the test in verbose mode. Installing multiple versions ---------------------------- On Unix and Mac systems if you intend to install multiple versions of Python using the same installation prefix (--prefix argument to the configure script) you must take care that your primary python executable is not overwritten by the installation of a different version. All files and directories installed using "make altinstall" contain the major and minor version and can thus live side-by-side. "make install" also creates ${prefix}/bin/python3 which refers to ${prefix}/bin/pythonX.Y. If you intend to install multiple versions using the same prefix you must decide which version (if any) is your "primary" version. Install that version using "make install". Install all other versions using "make altinstall". For example, if you want to install Python 2.5, 2.6 and 3.0 with 2.6 being the primary version, you would execute "make install" in your 2.6 build directory and "make altinstall" in the others. Issue Tracker and Mailing List ------------------------------ We're soliciting bug reports about all aspects of the language. Fixes are also welcome, preferable in unified diff format. Please use the issue tracker: http://bugs.python.org/ If you're not sure whether you're dealing with a bug or a feature, use the mailing list: python-dev@python.org To subscribe to the list, use the mailman form: http://mail.python.org/mailman/listinfo/python-dev/ Proposals for enhancement ------------------------- If you have a proposal to change Python, you may want to send an email to the comp.lang.python or python-ideas mailing lists for inital feedback. A Python Enhancement Proposal (PEP) may be submitted if your idea gains ground. All current PEPs, as well as guidelines for submitting a new PEP, are listed at http://www.python.org/dev/peps/. Release Schedule ---------------- See PEP 375 for release details: http://www.python.org/dev/peps/pep-0375/ Copyright and License Information --------------------------------- Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Python Software Foundation. All rights reserved. Copyright (c) 2000 BeOpen.com. All rights reserved. Copyright (c) 1995-2001 Corporation for National Research Initiatives. All rights reserved. Copyright (c) 1991-1995 Stichting Mathematisch Centrum. All rights reserved. See the file "LICENSE" for information on the history of this software, terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES. This Python distribution contains *no* GNU General Public License (GPL) code, so it may be used in proprietary projects. There are interfaces to some GNU code but these are entirely optional. All trademarks referenced herein are property of their respective holders.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值