Python简介及发展史
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Python,读作,翻译成汉语是蟒蛇的意思,并且Python的logo<span style="color: black;">亦</span>是两条缠绕在<span style="color: black;">一块</span>的蟒蛇的样子,然而Python语言和蟒蛇<span style="color: black;">实质</span>上并<span style="color: black;">无</span>一毛钱关系。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/1cbf68555bad4bc58f424ccafdc48008~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=RPJ%2B5ed7vMIB7Yk8dl0FoaCbmIg%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Python的口号是:“人生苦短,我用Python!”。这条口号<span style="color: black;">已然</span>被Python业界广泛<span style="color: black;">运用</span>,快<span style="color: black;">成为了</span><span style="color: black;">宣传</span>词一类的存在了。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/6d7bc6055b3b4d06ad17eb0d915a0f7d~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=77vnrIuQqC74pWIQiVbVjS5kSxE%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Python语言<span style="color: black;">是由于</span>荷兰程序员Guido van Rossum,江湖人<span style="color: black;">叫作</span>“龟叔”,独立<span style="color: black;">研发</span>完成初版的。“龟叔”曾供职于google,现任职于dropbox 。1989年圣诞节<span style="color: black;">时期</span>,在阿姆斯特丹,为了打发圣诞节的无趣,决心<span style="color: black;">研发</span>一个新的脚本解释语言,<span style="color: black;">做为</span>ABC语言的一种继承,<span style="color: black;">而后</span>他就这么做了,并实现了(大神的能力)。之<span style="color: black;">因此</span>选中Python<span style="color: black;">做为</span>该编程语言的名字,是<span style="color: black;">由于</span>他是一个叫Monty Python喜剧团体的<span style="color: black;">兴趣</span>者,其本意并不是想选条蟒蛇。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/b3ba156c0a4847ddabef061b597e6b4d~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=uR3Bgl5qR8JOF%2BTG1HN%2B4fTdEfU%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Python<span style="color: black;">第1</span>个公<span style="color: black;">研发</span>行版发行于1991年,<span style="color: black;">因此</span>这年被当作Python的诞生年。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Python 源代码遵循 GPL(GNU General Public License)协议,这是一个开源的协议,<span style="color: black;">亦</span><span style="color: black;">便是</span>说你可<span style="color: black;">以避免</span>费<span style="color: black;">运用</span>和传播它,而<span style="color: black;">不消</span>担心版权的问题。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">日前</span>Python<span style="color: black;">是由于</span>一个核心<span style="color: black;">研发</span>团队在<span style="color: black;">守护</span>,龟叔属于太上皇职位,仍然占据着至关重要的<span style="color: black;">功效</span>,<span style="color: black;">指点</span>其<span style="color: black;">发展</span>。</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">1、</span>Python的发展趋势</h1>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/140724bd2272401b9db681a87f6bdbf7~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=osNpArpZTpsBxHUy6Whdua4Avf4%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">从上图中,<span style="color: black;">咱们</span><span style="color: black;">能够</span>看出Python在<span style="color: black;">近期</span>3年<span style="color: black;">显现</span>了井喷式的发展。下图是2017年7月的TIOBE<span style="color: black;">全世界</span>编程语言热度排行榜,从中<span style="color: black;">咱们</span>能看出Python<span style="color: black;">已然</span>挤下C#,强势<span style="color: black;">插进</span>第四,当之无愧的解释类型语言领头羊。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/15cd67ea1826495480b3988052012591~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=X8uzODDixOUvuw7NqolNE5Ke6R4%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">前面<span style="color: black;">咱们</span>说了Python诞生自1991年,掰掰指头算算都26年了,比1995年的JAVA语言都早了4年,<span style="color: black;">为么</span>大器晚成,<span style="color: black;">此刻</span>才发力?</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">其一,在1990那个年代,计算机性能相比<span style="color: black;">此刻</span>差<span style="color: black;">非常多</span>,程序执行速度和效率很重要,快速<span style="color: black;">研发</span>不是<span style="color: black;">第1</span>要务,压榨<span style="color: black;">设备</span>性能才是。Python<span style="color: black;">做为</span>一门解释型动态语言,在解释方式上它天生就存在运行速度较慢的问题,<span style="color: black;">因此呢</span>不被当时编程界看好,其追求<span style="color: black;">研发</span>速度、强调简洁优雅、降低编程门槛的核心理念有点超越当时主流。而时<span style="color: black;">迄今</span>日,计算机的硬件性能<span style="color: black;">已然</span>得到数量级的<span style="color: black;">加强</span>,计算能力<span style="color: black;">再也不</span>是限制编程语言的最重要的<span style="color: black;">原因</span>,敏捷<span style="color: black;">研发</span><span style="color: black;">作为</span>生产环境下对语言<span style="color: black;">选取</span>的重要<span style="color: black;">原因</span>,Python很好的满足了这一点,从而得到快速发展。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">其二,Python出生<span style="color: black;">欠好</span>。<span style="color: black;">做为</span>对比的JAVA出身名门,其东家为SUN,当时互联网的头号<span style="color: black;">机构</span>,类似<span style="color: black;">此刻</span>Google的地位,因而得到大力推广,并且有一群能力强、专职、有组织的团队进行<span style="color: black;">研发</span>和<span style="color: black;">守护</span>,<span style="color: black;">因此</span><span style="color: black;">火速</span><span style="color: black;">得到</span>成功,普及开来,<span style="color: black;">迄今</span>仍然霸占着编程语言的榜首位置。而Python是个人编写的,寒门出身,龟叔<span style="color: black;">无</span>三头六臂,个人时间精力都是有限的,虽然有<span style="color: black;">有些</span>志愿者帮忙做<span style="color: black;">有些</span>事情,但无疑和JAVA的正规军相比,能量还是要差了<span style="color: black;">非常多</span>,这些都<span style="color: black;">引起</span>Python在初期发展得较为缓慢,<span style="color: black;">乃至</span>到如今都还未<span style="color: black;">处理</span>其被诟病的GIL问题。</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">2、</span>Python语言的特点</h1>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">1. 简单易学、<span style="color: black;">知道</span>优雅、<span style="color: black;">研发</span>速度快</h1><strong style="color: blue;">简单易学</strong>:与C和Java比,Python的学习成本和难度曲线不是低一点,更适合新手入门,自底向上的技术攀爬路线。先订个小<span style="color: black;">目的</span>爬个小山,<span style="color: black;">而后</span>再往更高的山峰前进。而不像C和JAVA光语言学习本身,<span style="color: black;">针对</span><span style="color: black;">非常多</span>人<span style="color: black;">来讲</span>就像珠穆朗玛峰<span style="color: black;">同样</span>高不可攀。<strong style="color: blue;"><span style="color: black;">知道</span>优雅</strong>:Python的语法非常简洁,代码量少,非常容易编写,代码的测试、重构、<span style="color: black;">守护</span>等都非常容易。一个小小的脚本,用C可能<span style="color: black;">必须</span>1000行,用JAVA可能几百行,<span style="color: black;">然则</span>用Python<span style="color: black;">常常</span>只<span style="color: black;">必须</span>几十行!<strong style="color: blue;"><span style="color: black;">研发</span>速度快</strong>:当前互联网企业的生命线是什么?<span style="color: black;">制品</span><span style="color: black;">研发</span>速度!<span style="color: black;">倘若</span>你的<span style="color: black;">研发</span>速度<span style="color: black;">不足</span>快,在你的<span style="color: black;">制品</span>推出之前别人家的<span style="color: black;">制品</span><span style="color: black;">已然</span>上线了,你<span style="color: black;">亦</span>就<span style="color: black;">无</span><span style="color: black;">存活</span>空间了,<span style="color: black;">这儿</span>的真实例子数<span style="color: black;">不堪</span>数。<span style="color: black;">那样</span>,Python的<span style="color: black;">研发</span>速度说第二没人敢<span style="color: black;">叫作</span><span style="color: black;">第1</span>!(不欢迎辩论^_^)<h1 style="color: black; text-align: left; margin-bottom: 10px;">2. 跨平台、可移植、可扩展、交互式、解释型、面向对象的动态语言</h1><strong style="color: blue;">跨平台</strong>:Python支持Windows、Linux和MAC os等主流操作系统。<strong style="color: blue;">可移植</strong>:代码<span style="color: black;">一般</span>不<span style="color: black;">必须</span>多少改动就能移植到别的平台上<span style="color: black;">运用</span>。<strong style="color: blue;">可扩展</strong>:Python语言本身由C语言编写而成的,你完全<span style="color: black;">能够</span>在Python中嵌入C,从而<span style="color: black;">加强</span>代码的运行速度和效率。你<span style="color: black;">亦</span><span style="color: black;">能够</span><span style="color: black;">运用</span>C语言重写Python的任何模块,从<span style="color: black;">基本</span>上改写Python,PyPy<span style="color: black;">便是</span>这么干的。<strong style="color: blue;">交互式</strong>:Python<span style="color: black;">供给</span>很好的人机交互界面,<span style="color: black;">例如</span>IDLE和IPython。<span style="color: black;">能够</span>从终端输入执行代码并<span style="color: black;">得到</span>结果,互动的测试和调试代码片断。<strong style="color: blue;">解释型</strong>:Python语言在执行过程中由解释器逐行分析,逐行运行并输出结果。<strong style="color: blue;">面向对象</strong>:Python语言具备所有的面向对象特性和功能,支持基于类的程序<span style="color: black;">研发</span>。<strong style="color: blue;">动态语言</strong>:在运行时<span style="color: black;">能够</span>改变其结构。例如新的函数、对象、<span style="color: black;">乃至</span>代码<span style="color: black;">能够</span>被引进,已有的函数<span style="color: black;">能够</span>被删除或是其他结构上的变化。动态语言非常<span style="color: black;">拥有</span>活力。<h1 style="color: black; text-align: left; margin-bottom: 10px;">3. “内置电池”,<span style="color: black;">海量</span>的标准库和第三方库</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Python为<span style="color: black;">咱们</span><span style="color: black;">供给</span>了非常完善的<span style="color: black;">基本</span>库,覆盖了系统、网络、文件、GUI、数据库、文本处理等方方面面,这些是随同解释器被默认安装的,各平台通用,你无需安装第三方支持就<span style="color: black;">能够</span>完成大多数工作,这一特点被形象地<span style="color: black;">叫作</span>作“内置电池(batteries included)”。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在程序员界,有一句话叫做“不要重复造轮子”。什么意思呢?<span style="color: black;">便是</span>说不要做重复的<span style="color: black;">研发</span>工作,<span style="color: black;">倘若</span>对某个问题<span style="color: black;">已然</span>有开源的<span style="color: black;">处理</span><span style="color: black;">方法</span><span style="color: black;">或</span>说第三方库,就不要自己去<span style="color: black;">研发</span>,直接用别人的就好。不要过分迷信自己的代码能力,要<span style="color: black;">晓得</span>,能<span style="color: black;">做为</span>标准库被Python内置,必然在<span style="color: black;">靠谱</span>性和算法效率上达到了<span style="color: black;">日前</span>最高水平,能被广泛<span style="color: black;">运用</span>的第三方库,必然<span style="color: black;">亦</span>是经受了<span style="color: black;">海量</span>的应用考验。除非<span style="color: black;">机构</span><span style="color: black;">需求</span>,不要自己去<span style="color: black;">研发</span>,请<span style="color: black;">运用</span>现成的库。<span style="color: black;">哪些</span>造轮子的事情,就交给世界最顶尖的那一波程序员去干吧,<span style="color: black;">无</span>极致的思维和数学能力,想创造好用的轮子是很难的。</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">4. 社区活跃,贡献者多,互帮互助</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">技术社区的存在就相当于程序员手中的指南针,<span style="color: black;">无</span>指南针,<span style="color: black;">非常多</span>时候,碰到了问题,就像无头的苍蝇只能到处乱飞,<span style="color: black;">最后</span>在茫茫的海洋中转晕致死。技术社区<span style="color: black;">能够</span>给<span style="color: black;">咱们</span>对语言的学习和<span style="color: black;">运用</span><span style="color: black;">供给</span>巨大的<span style="color: black;">帮忙</span>,无论是前期的学习,还是日后的工作,只要有问题,技术社区的大牛都<span style="color: black;">能够</span>帮<span style="color: black;">咱们</span><span style="color: black;">处理</span>,有这些助力,<span style="color: black;">能够</span>帮<span style="color: black;">咱们</span>更好地<span style="color: black;">认识</span>、学习和<span style="color: black;">运用</span>一门语言。技术社区<span style="color: black;">同期</span>还推动Python语言的发展方向,功能需求,<span style="color: black;">促进</span><span style="color: black;">机构</span>企业<span style="color: black;">更加多</span>的<span style="color: black;">运用</span>Python语言,招聘Python程序员。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">然而、然而,上面说的是国外。在国内,<span style="color: black;">好似</span><span style="color: black;">无</span>比较成熟,影响范围广的Python技术社区,还是说我见识浅薄不<span style="color: black;">晓得</span><span style="color: black;">罢了</span>?据<span style="color: black;">自己</span>分析,有历史<span style="color: black;">原由</span>和Python流行过程中形成的习惯等<span style="color: black;">原因</span>,国外Python<span style="color: black;">能手</span>都<span style="color: black;">爱好</span>用邮件列表、wiki等方式进行交流,而国内<span style="color: black;">爱好</span>的论坛、bbs等<span style="color: black;">无</span>形成规模,<span style="color: black;">因此</span><span style="color: black;">导致</span><span style="color: black;">此刻</span>的<span style="color: black;">情况</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">因此呢</span>,<span style="color: black;">朋友</span>们,学好英语,去和世界范围的程序员交流吧!</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">5. 开源语言,发展动力巨大</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Python是基于C语言编写的,并且<span style="color: black;">运用</span>GPL开源协议,你可<span style="color: black;">以避免</span>费获取它的源代码,进行学习、<span style="color: black;">科研</span><span style="color: black;">乃至</span>改进。众人拾柴火焰高,有<span style="color: black;">更加多</span>的人参与Python的<span style="color: black;">研发</span>,<span style="color: black;">促进</span>它更好的发展,被<span style="color: black;">更加多</span>的应用,形成良性循环。Python<span style="color: black;">为何</span>会越来越火<span style="color: black;">便是</span><span style="color: black;">由于</span>它的开放性,自由性,聚起了人气,形<span style="color: black;">成为了</span>社区,有<span style="color: black;">非常多</span>人在其中做贡献,用的人越来越多,自然就<span style="color: black;">加强</span>了市场占有率,企业、<span style="color: black;">机构</span>、厂家就不得不<span style="color: black;">运用</span>Python,<span style="color: black;">供给</span>的Python程序员岗位就越来越多,这<span style="color: black;">便是</span>开源的力量。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">这儿</span>附带跟<span style="color: black;">大众</span>说一个代码封闭的问题。Python写的源代码<span style="color: black;">一般</span>是不加密的,<span style="color: black;">倘若</span>要发布你的Python程序,<span style="color: black;">实质</span>上<span style="color: black;">便是</span>发布源代码,这一点跟C语言<span style="color: black;">区别</span>,C语言<span style="color: black;">不消</span>发布源代码,只<span style="color: black;">必须</span>把编译后的<span style="color: black;">设备</span>码(<span style="color: black;">亦</span><span style="color: black;">便是</span>你在Windows上<span style="color: black;">平常</span>的xxx.exe文件)发布出去。要从<span style="color: black;">设备</span>码反推出C代码基本是不可能的,<span style="color: black;">因此</span>,凡是编译型的语言,都<span style="color: black;">无</span>这个问题,而解释型的语言,则<span style="color: black;">必要</span>把源码发布出去。<span style="color: black;">倘若</span>你不想让别人看到或抄袭你写的python代码怎么办?<span style="color: black;">运用</span>类似py2exe的包装工具,将python源码转换成一个类似于exe可执行文件的形式,但这个<span style="color: black;">亦</span>不是绝对保险,只是<span style="color: black;">增多</span>了反编译的门槛和难度,<span style="color: black;">针对</span>有经验的人而言,<span style="color: black;">同样</span><span style="color: black;">能够</span><span style="color: black;">得到</span>你的源代码。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">你可能要问,我要<span style="color: black;">经过</span>写代码编软件卖出去挣钱怎么办?少年!<span style="color: black;">日前</span>的互联网时代,靠卖软件授权的<span style="color: black;">商场</span>模式越来越少了,靠网站服务和移动应用卖服务的模式越来越多了,这种模式不<span style="color: black;">必须</span>把源码给别人。再说了,<span style="color: black;">此刻</span>如火如荼的开源运动和互联网自由开放的精神是一致的,互联网上<span style="color: black;">有没有</span>数非常优秀的像Linux生态圈<span style="color: black;">同样</span>的开源项目,<span style="color: black;">咱们</span>千万不要高估自己写的代码真的有非常大的“<span style="color: black;">商场</span>价值”。在Python的世界,开源是王道,不要纠结你的代码被抄袭模仿,而是<span style="color: black;">尽可能</span><span style="color: black;">加强</span>自己的水平和能力,这才是立身之本。</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">3、</span>Python的应用方向</h1>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">1. 常规软件<span style="color: black;">研发</span></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Python支持函数式编程和OOP面向对象编程,能够承担任何种类软件的<span style="color: black;">研发</span>工作,<span style="color: black;">因此呢</span>常规的软件<span style="color: black;">研发</span>、脚本编写、网络编程等都属于标配能力。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/1d843aab53c34afcbca765d8879ab441~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=nTvoafoRGEqAAgGDx06IYxGBjbY%3D" style="width: 50%; margin-bottom: 20px;"></div>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">2. 科学计算</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">随着NumPy, SciPy, Matplotlib, Enthought librarys等众多程序库的<span style="color: black;">研发</span>,Python越来越适合于做科学计算、绘制高质量的2D和3D图像。和科学计算<span style="color: black;">行业</span>最流行的<span style="color: black;">商场</span>软件Matlab相比,Python是一门通用的程序设计语言,比Matlab所采用的脚本语言的应用范围更广泛,有<span style="color: black;">更加多</span>的程序库的支持。虽然Matlab中的许多高级功能和toolbox<span style="color: black;">日前</span>还是<span style="color: black;">没法</span>替代的,<span style="color: black;">不外</span>在<span style="color: black;">平常</span>的<span style="color: black;">研究</span><span style="color: black;">研发</span>之中仍然有<span style="color: black;">非常多</span>的工作是<span style="color: black;">能够</span>用Python代劳的。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/9954c2a33bba4c43a9751083d92962f8~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=O89AyEAizh9Ia7jGDoA%2BbNn2Y4w%3D" style="width: 50%; margin-bottom: 20px;"></div>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">3. 自动化运维</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">这几乎是Python应用的自留地,<span style="color: black;">做为</span>运维工程师首选的编程语言,Python在自动化运维方面<span style="color: black;">已然</span>深入人心,<span style="color: black;">例如</span>Saltstack和Ansible都是大名鼎鼎的自动化平台。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/6c28ccbb235840f888f9d6c6ce169ded~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=CUZdz81wWykCOAma3CY1nfKDZuc%3D" style="width: 50%; margin-bottom: 20px;"></div>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">4. 云计算</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">开源云计算<span style="color: black;">处理</span><span style="color: black;">方法</span>OpenStack<span style="color: black;">便是</span>基于Python<span style="color: black;">研发</span>的,搞云计算的<span style="color: black;">朋友</span>都懂的。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/95a1811bbc0e460ba30edd454972f73f~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=D01kjRZwfSShgFgCOjZbUhWaqVQ%3D" style="width: 50%; margin-bottom: 20px;"></div>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">5. WEB<span style="color: black;">研发</span></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">基于Python的Web<span style="color: black;">研发</span>框架不要太多,<span style="color: black;">例如</span>耳熟能详的Django,还有Tornado,Flask。其中的Python+Django架构,应用范围非常广,<span style="color: black;">研发</span>速度非常快,学习门槛<span style="color: black;">亦</span>很低,能够<span style="color: black;">帮忙</span>你快速的搭建起可用的WEB服务。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/1cdb3bf07de94a2481b074e6429b4ca6~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=RdjE31XOHA%2F5dXm6cd8T1M4eyaI%3D" style="width: 50%; margin-bottom: 20px;"></div>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">6. 网络爬虫</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">亦</span><span style="color: black;">叫作</span>网络蜘蛛,是大数据行业获取数据的核心工具。<span style="color: black;">无</span>网络爬虫自动地、不分昼夜地、高智能地在互联网上爬取免费的数据,<span style="color: black;">哪些</span>大数据<span style="color: black;">关联</span>的<span style="color: black;">机构</span>恐怕要少四分之三。能够编写网络爬虫的编程语言有不少,但Python绝对是其中的主流之一,其Scripy爬虫框架应用非常广泛。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/db2e96ad62cf475cbe5a8d278894c035~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=smCTqyt6PJ0gSt8rOcv0i9bd93M%3D" style="width: 50%; margin-bottom: 20px;"></div>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">7. 数据分析</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在<span style="color: black;">海量</span>数据的<span style="color: black;">基本</span>上,结合科学计算、<span style="color: black;">设备</span>学习等技术,对数据进行清洗、去重、规格化和针对性的分析是大数据行业的基石。Python是数据分析的主流语言之一。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/182e5da0c4f247f6ab5843e62c73264f~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=0LBpOXbnb9MfBPDdpUVDjS2zs44%3D" style="width: 50%; margin-bottom: 20px;"></div>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">8. 人工智能</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Python在人工智能大范畴<span style="color: black;">行业</span>内的<span style="color: black;">设备</span>学习、神经网络、深度学习等方面都是主流的编程语言,得到广泛的支持和应用。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/ac7c7a6cfb154db3a1df259035dbb0a4~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=IGnwfE258PEeRVRElZN8XC91GSI%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">当然,除了以上的主流和前沿<span style="color: black;">行业</span>,Python还在其他传统或特殊行业起着重要的<span style="color: black;">功效</span>。</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">4、</span>Python的<span style="color: black;">运用</span>者</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">说了这么多先进的当下最前沿的Python技术方向,<span style="color: black;">那样</span>有<span style="color: black;">那些</span><span style="color: black;">机构</span>在<span style="color: black;">运用</span>Python呢?</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在国内最有名的<span style="color: black;">便是</span>知乎和豆瓣了,它们<span style="color: black;">便是</span>基于Python<span style="color: black;">研发</span>的Web服务。其它的例如百度、阿里、淘宝 、<span style="color: black;">外链论坛:www.fok120.com</span>、金山、腾讯、盛大、网易、<span style="color: black;">马铃薯</span>、<span style="color: black;">外链</span>、果壳等<span style="color: black;">机构</span>都在<span style="color: black;">运用</span>Python完成<span style="color: black;">各样</span>各样的任务,几乎所有的互联网企业都在招聘Python程序员。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在国外,<span style="color: black;">更加是</span>数<span style="color: black;">不堪</span>数。谷歌的Google App Engine 、code.google.com 、Google earth 、谷歌爬虫、<span style="color: black;">宣传</span>等项目都在<span style="color: black;">海量</span><span style="color: black;">运用</span>Python进行<span style="color: black;">研发</span>。还有Facebook、Twitter等等等等。几乎所有的Linux发行版都内置Python解释器。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">下面是一张不完全的统计图:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/7f8f8baf64954adf9e3a85de0b1dc53d~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=g8w5eU0LEKysdH3qQaYlYoTwRJg%3D" style="width: 50%; margin-bottom: 20px;"></div>
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">5、</span>Python的缺点</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">咱们</span>光说了Python的优点,<span style="color: black;">亦</span>得说说它的缺点。任何编程语言都有缺点,Python<span style="color: black;">亦</span>不例外。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">第1</span>个缺点<span style="color: black;">便是</span>运行速度相对慢点,和C程序相比慢不少,这是解释型语言的通病,你的Python代码在执行时会一行一行地翻译成CPU能理解的<span style="color: black;">设备</span>码,这个翻译过程非常耗时,<span style="color: black;">因此</span>会变慢。而C程序<span style="color: black;">做为</span>编译型语言是运行前直接编译成CPU能执行的<span style="color: black;">设备</span>码,<span style="color: black;">因此</span>非常快。(但<span style="color: black;">同期</span>你<span style="color: black;">能够</span>这么理解,C语言把费时间的活在生产上线之前先花时间干了,<span style="color: black;">因此</span>运行时就快了。)</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/9d33d2778f7a4f51b8ca9f85ced21931~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=p1ARzz7Ie1Z9QnbUMrsFzRh5Nwg%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">然则</span>Python的慢,<span style="color: black;">无</span>你想象中的<span style="color: black;">那样</span>严重<span style="color: black;">那样</span>重要,<span style="color: black;">由于</span>:</p>程序速度<span style="color: black;">再也不</span><span style="color: black;">那样</span>重要,不<span style="color: black;">必定</span>非要追求极致:<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">前面其实<span style="color: black;">咱们</span><span style="color: black;">已然</span><span style="color: black;">说到</span>过,早些时期CPU比较昂贵,计算资源很吃紧,内存<span style="color: black;">亦</span>很贵,程序运行的速度和耗费的时间就很重要。这<span style="color: black;">便是</span><span style="color: black;">引起</span>计算机科学致力于<span style="color: black;">科研</span><span style="color: black;">区别</span>算法的效率的<span style="color: black;">原由</span>之一。然而,这<span style="color: black;">已然</span><span style="color: black;">再也不</span>是最重要的<span style="color: black;">原因</span>,<span style="color: black;">由于</span><span style="color: black;">此刻</span>芯片很便宜,<span style="color: black;">况且</span>运行速度有了质的<span style="color: black;">提高</span>。运行时间<span style="color: black;">再也不</span>是你最贵的资源。<span style="color: black;">机构</span>最贵的资源<span style="color: black;">此刻</span>是员工时间。或者换句话说,<span style="color: black;">便是</span>你。在规<span style="color: black;">按时</span>间内把事情做完比把程序变快更加重要。Python语法简洁,<span style="color: black;">包括</span><span style="color: black;">海量</span>的标准库和第三方库,用较少的语句就<span style="color: black;">能够</span>完成其它语言上百条语句<span style="color: black;">才可</span>完成的任务,这无疑大大<span style="color: black;">加强</span>了<span style="color: black;">研发</span>的速度和效率,<span style="color: black;">帮忙</span>你在尽可能短的时间内完成工作。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">这儿</span>并不是说速度一点<span style="color: black;">亦</span>不重要,只是说速度<span style="color: black;">再也不</span>是<span style="color: black;">独一</span>重要的东西和<span style="color: black;">独一</span><span style="color: black;">思虑</span>的东西。 <span style="color: black;">此刻</span>,<span style="color: black;">制品</span>的<span style="color: black;">开发</span>速度远比程序运行速度更重要。在一天结束时,让你的<span style="color: black;">机构</span>存活下来<span style="color: black;">或</span>死去的<span style="color: black;">独一</span>事物<span style="color: black;">便是</span><span style="color: black;">制品</span>上市时间。<span style="color: black;">机构</span>能够存活下来的<span style="color: black;">独一</span><span style="color: black;">办法</span><span style="color: black;">便是</span>比你的竞争对手更快地创新。<span style="color: black;">倘若</span>在你的<span style="color: black;">制品</span>上市之前,你的竞争对手<span style="color: black;">已然</span>提前上市了,<span style="color: black;">那样</span>你想出了多少好的主意<span style="color: black;">亦</span>将<span style="color: black;">再也不</span>重要。</p>在<span style="color: black;">全部</span>体系中有比Python程序运行得更慢的瓶颈:<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">倘若</span>你在写一个网络应用程序,如web服务,<span style="color: black;">特别有</span>可能的<span style="color: black;">状况</span>是,CPU时间并不是你的程序的瓶颈。当你的web服务器处理一个请求时,可能会进行几次网络调用,例如到数据库,<span style="color: black;">或</span>像Redis<span style="color: black;">这般</span>的缓存服务器。虽然这些服务本身可能比较快速,<span style="color: black;">然则</span>对它们的网络调用却很慢。<span style="color: black;">倘若</span>一个单独的CPU周期等同于1秒,<span style="color: black;">那样</span>一个从北京到上海的网络调用将相当于1年。可见网络调用是多么的慢。这说明什么呢?说明Python不是系统中最慢的那个部分,有比它慢数量级的运行瓶颈卡在系统中间,制约着<span style="color: black;">全部</span>系统的运行速度。</p>但无论怎么样,Python慢是事实。<span style="color: black;">倘若</span>你真的对<span style="color: black;">加强</span>Python运行速度有需求,你<span style="color: black;">能够</span><span style="color: black;">运用</span>C来写,<span style="color: black;">而后</span>在Python中调用它。<span style="color: black;">另一</span>,程序员大牛Donald Knuth说过过早优化是万恶之源。在<span style="color: black;">研发</span>的中<span style="color: black;">初期</span>,追求运行速度和效率是费力不讨好的,进行敏捷<span style="color: black;">研发</span>和快速迭代才是当下软件<span style="color: black;">研发</span>的王道模式,而Python正是为此而生。<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">第二个问题<span style="color: black;">便是</span>GIL(Global Interpreter Lock)全局解释器锁,这是一种防止多线程并发执行<span style="color: black;">设备</span>码的互斥锁,功能和性能之间权衡后的产物。这是在设计Python语言的时候留下的一个历史性遗留问题,<span style="color: black;">亦</span>是限于当时技术团队实力有限。<span style="color: black;">详细</span>的技术细节先不解释,其<span style="color: black;">导致</span>的后果<span style="color: black;">便是</span>Python在进行多线程任务的时候,其实是伪多线程,性能较差,这一点<span style="color: black;">始终</span>被诟病,<span style="color: black;">大众</span>随便在某个技术论坛里都能找到对这个问题的激烈讨论。Python的这个问题事实存在,一段时间内<span style="color: black;">亦</span>是<span style="color: black;">没法</span><span style="color: black;">处理</span>的,<span style="color: black;">为何</span>呢?这<span style="color: black;">必须</span>从底层重新设计Python,难度之大,工作量之大,对现有生态圈的影响非常巨大。<span style="color: black;">那样</span>有什么<span style="color: black;">处理</span>办法?<span style="color: black;">运用</span>非官方的PyPy解释器<span style="color: black;">或</span>协程机制。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/6714cc47590a494bad1117a5897476fd~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723895396&x-signature=r1XFb6efCyAPPmQAbD9lRcZDDCc%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">第三个不是缺点的问题是Python2和Python3的不兼容性。在后面会有论述。</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">6、</span> Python之禅</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">最后,让<span style="color: black;">咱们</span>以Python的官方格言,<span style="color: black;">亦</span><span style="color: black;">便是</span>俗<span style="color: black;">叫作</span>的Python之禅来结束对Python的介绍。在Python的IDLE<span style="color: black;">或</span>交互式解释器中,输入import this,你就会看到下面的一段话:</p><span style="color: black;">The</span> <span style="color: black;">Zen of Python, by Tim Peters</span>
<span style="color: black;">Beautiful</span> <span style="color: black;">is better than ugly.</span>
<span style="color: black;">Explicit</span> <span style="color: black;">is better than implicit.</span>
<span style="color: black;">Simple</span> <span style="color: black;">is better than complex.</span>
<span style="color: black;">Complex</span> <span style="color: black;">is better than complicated.</span>
<span style="color: black;">Flat</span> <span style="color: black;">is better than nested.</span>
<span style="color: black;">Sparse</span> <span style="color: black;">is better than dense.</span>
<span style="color: black;">Readability</span> <span style="color: black;">counts.</span>
<span style="color: black;">Special</span> <span style="color: black;">cases arent special enough to break the rules.</span>
<span style="color: black;">Although</span> <span style="color: black;">practicality beats purity.</span>
<span style="color: black;">Errors</span> <span style="color: black;">should never pass silently.</span>
<span style="color: black;">Unless</span> <span style="color: black;">explicitly silenced.</span>
<span style="color: black;">In</span> <span style="color: black;">the face of ambiguity, refuse the temptation to guess.</span>
<span style="color: black;">There</span> <span style="color: black;">should be one-- and preferably only one --obvious way to do it.</span>
<span style="color: black;">Although</span> <span style="color: black;">that way may not be obvious at first unless youre Dutch.</span>
<span style="color: black;">Now</span> <span style="color: black;">is better than never.</span>
<span style="color: black;">Although</span> <span style="color: black;">never is often better than *right* now.</span>
<span style="color: black;">If</span> <span style="color: black;">the implementation is hard to explain, its a bad idea.</span>
<span style="color: black;">If</span> <span style="color: black;">the implementation is easy to explain, it may be a good idea.</span>
<span style="color: black;">Namespaces</span> <span style="color: black;">are one honking great idea -- lets do more of those!</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">翻译过来的意思<span style="color: black;">便是</span>:</p>优美<span style="color: black;">强过</span>丑陋(Python 以编写优美的代码为<span style="color: black;">目的</span>)
明了<span style="color: black;">强过</span>晦涩(优美的代码应当是明了的,命名规范,风格<span style="color: black;">类似</span>)
简洁<span style="color: black;">强过</span><span style="color: black;">繁杂</span>(优美的代码应当是简洁的,不要有<span style="color: black;">繁杂</span>的内部实现)
<span style="color: black;">繁杂</span><span style="color: black;">强过</span>凌乱(<span style="color: black;">倘若</span><span style="color: black;">繁杂</span>不可避免,那代码间<span style="color: black;">亦</span><span style="color: black;">不可</span>有难懂的关系,要保持接口简洁)
扁平<span style="color: black;">强过</span>嵌套(优美的代码应当是扁平的,<span style="color: black;">不可</span>有太多的嵌套)
间隔<span style="color: black;">强过</span>紧凑(优美的代码有适当的间隔,不要奢望一行代码<span style="color: black;">处理</span>问题)
可读性很重要(优美的代码是可读的)
即便假借特例的实用性之名,<span style="color: black;">亦</span>不可违背这些规则(这些规则至高无上)
不要<span style="color: black;">包涵</span>所有错误,除非你确定<span style="color: black;">必须</span><span style="color: black;">这般</span>做(<span style="color: black;">精细</span>地<span style="color: black;">捕捉</span><span style="color: black;">反常</span>,不写<span style="color: black;">except</span>:<span style="color: black;">pass</span>风格的代码)
当存在多种可能,不要尝试去猜测而是<span style="color: black;">尽可能</span>找一种,最好是<span style="color: black;">独一</span>一种<span style="color: black;">显著</span>的<span style="color: black;">处理</span><span style="color: black;">方法</span>(<span style="color: black;">倘若</span>不确定,就用穷举法)
虽然这并<span style="color: black;">不易</span>,<span style="color: black;">由于</span>你不是 Python 之父(<span style="color: black;">这儿</span>的 Dutch <span style="color: black;">指的是</span> Guido )
做<span style="color: black;">亦</span>许好过不做,但不假思索就动手还不如不做(动手之前要细思量)
<span style="color: black;">倘若</span>你<span style="color: black;">没法</span>向人描述你的<span style="color: black;">方法</span>,那肯定不是一个好<span style="color: black;">方法</span>;反之<span style="color: black;">也</span>然(<span style="color: black;">方法</span>测评标准)
命名空间是一种绝妙的理念,<span style="color: black;">咱们</span>应当多加利用(倡导与号召)<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">倘若</span>你深入理解并实践了以上的精神,<span style="color: black;">能够</span>肯定的是你的代码水平会得到<span style="color: black;">极重</span>的<span style="color: black;">加强</span>!</p>
外贸B2B平台有哪些? 我完全同意你的看法,期待我们能深入探讨这个问题。
页:
[1]