<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python on 庞玉栋个人博客</title><link>https://pangyd.com/tags/python/</link><description>Recent content in Python on 庞玉栋个人博客</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Thu, 22 Nov 2018 19:06:54 +0800</lastBuildDate><atom:link href="https://pangyd.com/tags/python/index.xml" rel="self" type="application/rss+xml"/><item><title>人生苦短,我用python “Life is short. You need Python.”</title><link>https://pangyd.com/post/207-python-life-is-short-you-need-python/</link><pubDate>Fri, 09 Nov 2018 08:22:51 +0800</pubDate><guid>https://pangyd.com/post/207-python-life-is-short-you-need-python/</guid><description>&lt;p>&lt;img src="https://pangyd.com/uploads/2018/09/f0c1d12340235ebb.jpg" alt="index.jpg">&lt;/p>&lt;p>&lt;span>&lt;span>Python 在约 40 年前出现，现在已经有数以千计基于这项技术的网站和软件项目。Python 因其独有的特点从众多开发语言中脱颖而出，深受世界各地的开发者喜爱。&lt;/span>&lt;/span>&lt;/p>&lt;p style="text-align: center">&lt;span>正文共：4565 字&amp;nbsp;&lt;/span>&lt;/p>&lt;p style="text-align: center">&lt;span>预计阅读时间：12 分钟&lt;/span>&lt;/p>&lt;p>人生苦短， 我用 Python ，不知道从什么时候开始，这句话开始流行。&lt;/p>&lt;p>&lt;img title="" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='120'%3E%3Crect width='480' height='120' fill='%230E1012' stroke='%231B1E22'/%3E%3Ctext x='240' y='66' fill='%235C6069' font-family='monospace' font-size='13' text-anchor='middle'%3E%5B%E5%8E%9F%E5%9B%BE%E5%B7%B2%E5%A4%B1%E6%95%88%5D%3C/text%3E%3C/svg%3E" alt="640?wx_fmt=jpeg&amp;wxfrom=5&amp;wx_lazy=1" border="0">&lt;/p>&lt;p>人们可能会说， 2017 年是 Python 辉煌的一年。毕竟在这一年中，Python 的增长速度令人惊艳。&lt;/p>&lt;p>&lt;img title="" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='120'%3E%3Crect width='480' height='120' fill='%230E1012' stroke='%231B1E22'/%3E%3Ctext x='240' y='66' fill='%235C6069' font-family='monospace' font-size='13' text-anchor='middle'%3E%5B%E5%8E%9F%E5%9B%BE%E5%B7%B2%E5%A4%B1%E6%95%88%5D%3C/text%3E%3C/svg%3E" alt="640?wx_fmt=jpeg&amp;wxfrom=5&amp;wx_lazy=1" border="0">&lt;/p>&lt;p style="text-align: center">&lt;span>主要编程语言的增长趋势，图片来自 Stack Overflow&lt;/span>&lt;/p>&lt;p>在GitHub 2017年度报告中，Python 超越 Java 成第二受欢迎语言。在 ranked.com 的排名中，Python 是 2017 年最受欢迎人工智能编程语言（第二是 C++，R 并未上榜）。&lt;/p>&lt;p>根据 Stack Overflow 流量统计，2017 年 6 月，Python 第一次成为高收入国家 Stack Overflow 访问量最大的标签。&lt;/p>&lt;p>&lt;img class="img_loading" title="" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='120'%3E%3Crect width='480' height='120' fill='%230E1012' stroke='%231B1E22'/%3E%3Ctext x='240' y='66' fill='%235C6069' font-family='monospace' font-size='13' text-anchor='middle'%3E%5B%E5%8E%9F%E5%9B%BE%E5%B7%B2%E5%A4%B1%E6%95%88%5D%3C/text%3E%3C/svg%3E" alt="640?wx_fmt=jpeg" border="0">&lt;/p>&lt;p>在 TIOBE 2018 年 4 月编程语言排行榜前 20 名中，Python 已跃居到第四位，前三分别为为 Java ，C、C++。&lt;/p></description></item><item><title>python的redis简单使用</title><link>https://pangyd.com/post/203-pythonredis/</link><pubDate>Mon, 05 Nov 2018 06:54:40 +0800</pubDate><guid>https://pangyd.com/post/203-pythonredis/</guid><description>&lt;p>安装的Python版本&amp;nbsp;3.6.1&lt;/p>
&lt;p>redis安装的2.8&lt;/p>
&lt;p>安装redis模块&lt;/p>
&lt;div class="cnblogs_code">
&lt;pre>pip install redis&lt;/pre>
&lt;/div>
&lt;p>&lt;img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='120'%3E%3Crect width='480' height='120' fill='%230E1012' stroke='%231B1E22'/%3E%3Ctext x='240' y='66' fill='%235C6069' font-family='monospace' font-size='13' text-anchor='middle'%3E%5B%E5%8E%9F%E5%9B%BE%E5%B7%B2%E5%A4%B1%E6%95%88%5D%3C/text%3E%3C/svg%3E" alt="">&lt;/p>
&lt;p>简单使用&lt;/p>
&lt;p>redis-test.py&lt;/p>
&lt;div class="cnblogs_code">
&lt;pre>&lt;span>import&lt;/span>&lt;span> redis
r&lt;/span>=redis.Redis(host=&lt;span>'&lt;/span>&lt;span>127.0.0.1&lt;/span>&lt;span>'&lt;/span>,port=6609,db=&lt;span>0)
r.set(&lt;/span>&lt;span>'&lt;/span>&lt;span>name&lt;/span>&lt;span>'&lt;/span>,&lt;span>'&lt;/span>&lt;span>baby&lt;/span>&lt;span>'&lt;/span>&lt;span>)
&lt;/span>&lt;span>print&lt;/span>(r.get(&lt;span>'&lt;/span>&lt;span>name&lt;/span>&lt;span>'&lt;/span>&lt;span>))
&lt;/span>&lt;span>print&lt;/span>(r.dbsize())&lt;/pre>
&lt;/div>
&lt;p>&lt;img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='120'%3E%3Crect width='480' height='120' fill='%230E1012' stroke='%231B1E22'/%3E%3Ctext x='240' y='66' fill='%235C6069' font-family='monospace' font-size='13' text-anchor='middle'%3E%5B%E5%8E%9F%E5%9B%BE%E5%B7%B2%E5%A4%B1%E6%95%88%5D%3C/text%3E%3C/svg%3E" alt="">&lt;/p>
&lt;p>使用connection pool来管理对一个redis server的所有连接，避免每次建立、释放连接的开销。&lt;/p>
&lt;p>默认，每个Redis实例都会维护一个自己的连接池。&lt;/p>
&lt;p>可以直接建立一个连接池，然后作为参数 Redis，这样就可以实现多个Redis实例共享一个连接池&lt;/p>
&lt;p>使用连接池&lt;/p>
&lt;div class="cnblogs_code">
&lt;pre> &lt;span>import&lt;/span>&lt;span> redis
 pool &lt;/span>= redis.ConnectionPool(host=&lt;span>'&lt;/span>&lt;span>127.0.0.1&lt;/span>&lt;span>'&lt;/span>,port=6609&lt;span>)
 r &lt;/span>= redis.Redis(connection_pool=&lt;span>pool)
 r.set(&lt;/span>&lt;span>'&lt;/span>&lt;span>name1&lt;/span>&lt;span>'&lt;/span>,&lt;span>'&lt;/span>&lt;span>lili&lt;/span>&lt;span>'&lt;/span>&lt;span>)
 &lt;/span>&lt;span>print&lt;/span>(r.get(&lt;span>'&lt;/span>&lt;span>name1&lt;/span>&lt;span>'&lt;/span>))&lt;/pre>
&lt;/div>
&lt;p>&amp;nbsp;&lt;/p>
&lt;p>应用：页面点击数&lt;/p>
&lt;p>　　需要对一系列页面记录点击次数，如果使用关系数据库来存储点击，可能存在大量的行级锁争用&lt;/p>
&lt;p>　　(1)当redis服务器启动时，可以从关系数据库读入点击数的初始值&lt;/p>
&lt;div class="cnblogs_code">
&lt;pre>&lt;span>import&lt;/span>&lt;span> redis
r&lt;/span>=redis.Redis(host=&lt;span>'&lt;/span>&lt;span>127.0.0.1&lt;/span>&lt;span>'&lt;/span>,port=6609,db=&lt;span>0)
r.set(&lt;/span>&lt;span>'&lt;/span>&lt;span>visits:100&lt;/span>&lt;span>'&lt;/span>,999)&lt;/pre>
&lt;/div>
&lt;p>　　(2)有人访问页面时&lt;/p>
&lt;div class="cnblogs_code">
&lt;pre>r.incr(&lt;span>'&lt;/span>&lt;span>visits:100&lt;/span>&lt;span>'&lt;/span>)&lt;/pre>
&lt;/div>
&lt;p>　　(3)获取页面点击数&lt;/p>
&lt;div class="cnblogs_code">
&lt;pre>r.get(&lt;span>'&lt;/span>&lt;span>visits:100&lt;/span>&lt;span>'&lt;/span>)&lt;/pre>
&lt;/div>
&lt;p>Pipeline 是 StrictRedis 类的子类，支持在一个请求里发送缓冲的多个命令。通过减少客户端和服务器之间往来的数据包，可以大大提高命令组的性能&lt;/p>
&lt;p>简单使用&lt;/p>
&lt;div class="cnblogs_code">
&lt;pre>&amp;gt;&amp;gt;&amp;gt;&lt;span>import&lt;/span>&lt;span> redis 
&lt;/span>&amp;gt;&amp;gt;&amp;gt;r=redis.Redis(host=&lt;span>'&lt;/span>&lt;span>127.0.0.1&lt;/span>&lt;span>'&lt;/span>,port=6609,db=&lt;span>0)
&lt;/span>&amp;gt;&amp;gt;&amp;gt; r.set(&lt;span>'&lt;/span>&lt;span>name&lt;/span>&lt;span>'&lt;/span>, &lt;span>'&lt;/span>&lt;span>baby&lt;/span>&lt;span>'&lt;/span>&lt;span>)
&lt;/span>&amp;gt;&amp;gt;&amp;gt; pipe =&lt;span> r.pipeline()
&lt;/span>&amp;gt;&amp;gt;&amp;gt; pipe.set(&lt;span>'&lt;/span>&lt;span>birthday&lt;/span>&lt;span>'&lt;/span>, &lt;span>'&lt;/span>&lt;span>2010&lt;/span>&lt;span>'&lt;/span>&lt;span>)
&lt;/span>&amp;gt;&amp;gt;&amp;gt; pipe.get(&lt;span>'&lt;/span>&lt;span>name&lt;/span>&lt;span>'&lt;/span>&lt;span>)
&lt;/span>&amp;gt;&amp;gt;&amp;gt; pipe.execute()&lt;/pre>
&lt;/div>
&lt;p>为了方便使用，所有缓冲到 pipeline 的命令返回 pipeline 对象本身&lt;/p></description></item><item><title>15张脑图看懂 Python 编程核心知识体系</title><link>https://pangyd.com/post/154-15-python/</link><pubDate>Sat, 04 Nov 2017 22:27:14 +0800</pubDate><guid>https://pangyd.com/post/154-15-python/</guid><description>&lt;p>首先，按顺序依次展示了以下内容的一系列思维导图：基础知识，数据类型（数字，字符串，列表，元组，字典，集合），条件&amp;amp;循环，文件对象，错误&amp;amp;异常，函数，模块，面向对象编程；&lt;/p>&lt;p>接着，结合这些思维导图主要参考的资料，分享一下我的学习体验，一方面可供初学者参考，另一方面，也便于大家结合思维导图深入学习、理解、思考；&lt;/p>&lt;p>最后，提供几篇文章链接，方便希望从 Python 2.x 迁移到 3.x 的朋友理解。&lt;/p>&lt;p>编程是这样一件美妙的事情，如果你没有开始，你不知道会错过一种多么棒的体验。Just try it~和大家共勉！&lt;/p>&lt;p>注意事项：&lt;/p>&lt;p>思维导图：&lt;/p>&lt;p>默认阅读顺序：从右左，顺时针方向。&lt;/p>&lt;p>思维导图软件：XMind&lt;/p>&lt;p>总览：&lt;/p>&lt;p>&lt;img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='120'%3E%3Crect width='480' height='120' fill='%230E1012' stroke='%231B1E22'/%3E%3Ctext x='240' y='66' fill='%235C6069' font-family='monospace' font-size='13' text-anchor='middle'%3E%5B%E5%8E%9F%E5%9B%BE%E5%B7%B2%E5%A4%B1%E6%95%88%5D%3C/text%3E%3C/svg%3E" data-size="1000|896">&lt;/p>&lt;p>14 张思维导图基础知识&lt;/p>&lt;p>&lt;img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='120'%3E%3Crect width='480' height='120' fill='%230E1012' stroke='%231B1E22'/%3E%3Ctext x='240' y='66' fill='%235C6069' font-family='monospace' font-size='13' text-anchor='middle'%3E%5B%E5%8E%9F%E5%9B%BE%E5%B7%B2%E5%A4%B1%E6%95%88%5D%3C/text%3E%3C/svg%3E" data-size="1000|603">&lt;/p>&lt;p>&lt;img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='120'%3E%3Crect width='480' height='120' fill='%230E1012' stroke='%231B1E22'/%3E%3Ctext x='240' y='66' fill='%235C6069' font-family='monospace' font-size='13' text-anchor='middle'%3E%5B%E5%8E%9F%E5%9B%BE%E5%B7%B2%E5%A4%B1%E6%95%88%5D%3C/text%3E%3C/svg%3E" data-size="1000|695">&lt;/p>&lt;p>数据类型&lt;/p>&lt;p>&lt;img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='120'%3E%3Crect width='480' height='120' fill='%230E1012' stroke='%231B1E22'/%3E%3Ctext x='240' y='66' fill='%235C6069' font-family='monospace' font-size='13' text-anchor='middle'%3E%5B%E5%8E%9F%E5%9B%BE%E5%B7%B2%E5%A4%B1%E6%95%88%5D%3C/text%3E%3C/svg%3E" data-size="640|421">&lt;/p>&lt;p>&lt;/p>&lt;p>序列&lt;/p>&lt;p>&lt;img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='120'%3E%3Crect width='480' height='120' fill='%230E1012' stroke='%231B1E22'/%3E%3Ctext x='240' y='66' fill='%235C6069' font-family='monospace' font-size='13' text-anchor='middle'%3E%5B%E5%8E%9F%E5%9B%BE%E5%B7%B2%E5%A4%B1%E6%95%88%5D%3C/text%3E%3C/svg%3E" data-size="640|856">&lt;/p>&lt;p>字符串&lt;/p>&lt;p>&lt;img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='120'%3E%3Crect width='480' height='120' fill='%230E1012' stroke='%231B1E22'/%3E%3Ctext x='240' y='66' fill='%235C6069' font-family='monospace' font-size='13' text-anchor='middle'%3E%5B%E5%8E%9F%E5%9B%BE%E5%B7%B2%E5%A4%B1%E6%95%88%5D%3C/text%3E%3C/svg%3E" data-size="1000|734">&lt;/p>&lt;p>列表 &amp;amp; 元组&lt;/p>&lt;p>&lt;img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='120'%3E%3Crect width='480' height='120' fill='%230E1012' stroke='%231B1E22'/%3E%3Ctext x='240' y='66' fill='%235C6069' font-family='monospace' font-size='13' text-anchor='middle'%3E%5B%E5%8E%9F%E5%9B%BE%E5%B7%B2%E5%A4%B1%E6%95%88%5D%3C/text%3E%3C/svg%3E" data-size="640|286">&lt;/p>&lt;p>字典 &amp;amp; 集合&lt;/p>&lt;p>&lt;img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='120'%3E%3Crect width='480' height='120' fill='%230E1012' stroke='%231B1E22'/%3E%3Ctext x='240' y='66' fill='%235C6069' font-family='monospace' font-size='13' text-anchor='middle'%3E%5B%E5%8E%9F%E5%9B%BE%E5%B7%B2%E5%A4%B1%E6%95%88%5D%3C/text%3E%3C/svg%3E" data-size="640|376">&lt;/p>&lt;p>条件 &amp;amp; 循环&lt;/p></description></item><item><title>python爬虫——写出最简单的网页爬虫</title><link>https://pangyd.com/post/97-python/</link><pubDate>Sat, 09 Sep 2017 17:08:42 +0800</pubDate><guid>https://pangyd.com/post/97-python/</guid><description>&lt;section data-tools="135编辑器" data-id="89974" style="text-align: justify">&lt;section data-id="us538844">&lt;section>&lt;p>&lt;span class="bannerfix-wrapper" style="text-align: center">&lt;img data-s="300,640" data-type="jpeg" data-src="//qqpublic.qpic.cn/qq_public/0/0-2599578271-A1CD3C3D44AED332B9085FFD7BA070AD/0?fmt=jpg&amp;size=31&amp;rs=23-21&amp;h=427&amp;w=640&amp;ppv=1" data-ratio="0.66640625" data-w="1280" src="https://pangyd.com/uploads/2017/09/1b8214ac44494614.jpg" data-fail="0" data-ueid="20895" width="640" height="auto" data-width="640" data-height="427" data-org="https://mmbiz.qpic.cn/mmbiz_jpg/Mzws9oBx0P7kQpiaL4oQG7TZxbZ6hwFdlbmh5WVswicJbvugib0w0ujibUqXjvUgFuUSme9lNFeDeiaVoric6jSpvmGA/640?wx_fmt=jpeg&amp;wxfrom=5&amp;wx_lazy=1" data-lazy="0">&lt;/span>&lt;/p>&lt;/section>&lt;/section>&lt;/section>&lt;section data-id="us538844" style="text-align: justify">&lt;section>&lt;section>&lt;p>&lt;span>在我们日常上网浏览网页的时候，经常会看到一些好看的图片，我们就希望把这些图片保存下载，或者用户用来做桌面壁纸，或者用来做设计的素材。&lt;/span>&lt;span>我们可以通过&lt;/span>&lt;span>python&amp;nbsp;&lt;/span>&lt;span>来实现这样一个简单的爬虫功能，把我们想要的代码爬取到本地。下面就看看如何使用&lt;/span>&lt;span>python&lt;/span>&lt;span>来实现这样一个功能。&lt;/span>&lt;/p>&lt;/section>&lt;section data-width="100%">&lt;section>&lt;img data-src="//qqpublic.qpic.cn/qq_public/0/0-2516127415-94DD69FAB0632899CD9E62C400ADDFE6/0?fmt=png&amp;size=1&amp;rs=1-0&amp;h=37&amp;w=43&amp;ppv=1" data-ratio="0.8604651162790697" data-w="43" data-type="png" src="https://pangyd.com/uploads/2017/09/1b8214ac44494614.jpg" data-fail="0" data-ueid="592180" width="43" height="auto" data-width="43" data-height="37" data-org="https://mmbiz.qpic.cn/mmbiz_png/Mzws9oBx0P7kQpiaL4oQG7TZxbZ6hwFdlSWdbiaWc3zB05Dc3TN73GB0wFsJZ2xN6V1BlNytSzCqpkOSErJWEKRQ/0.png?wxfrom=5&amp;wx_lazy=1" data-lazy="0">&lt;/section>&lt;/section>&lt;/section>&lt;/section>&lt;section data-id="us538906" style="text-align: justify">&lt;section>&lt;section data-width="100%">&lt;section data-brushtype="text">&lt;span>&lt;strong>开发工具&lt;/strong>&lt;/span>&lt;/section>&lt;/section>&lt;/section>&lt;/section>&lt;p style="text-align: justify">&lt;span>笔者使用的工具是sublimetext3，它的短小精悍（可能男人们都不喜欢这个词）使我十分着迷。推荐大家使用，当然如果你的电脑配置不错，pycharm可能更加适合你。&lt;/span>&lt;/p>&lt;p style="text-align: justify">&lt;span>sublime text3搭建python开发环境推荐查看此博客：&lt;/span>&lt;/p>&lt;p style="text-align: justify">&lt;span>[sublime搭建python开发环境]&lt;/span>&lt;span>[https://www.cnblogs.com/codefish/p/4806849.&lt;/span>&lt;/p>&lt;section data-id="us538906" style="text-align: justify">&lt;section>&lt;section data-width="100%">&lt;section data-brushtype="text">&lt;span>&lt;strong>爬虫介绍&lt;/strong>&lt;/span>&lt;/section>&lt;/section>&lt;/section>&lt;/section>&lt;p style="text-align: justify">&lt;span>&lt;span>爬虫顾名思义，就是像虫子一样，爬在&lt;/span>Internet&lt;span>这张大网上。如此，我们便可以获取自己想要的东西。&lt;/span>&lt;/span>&lt;/p>&lt;p style="text-align: justify">&lt;span>&lt;span>既然要爬在&lt;/span>Internet&lt;span>上，那么我们就需要了解&lt;/span>URL&lt;span>，法号&lt;/span>“&lt;span>统一资源定位器&lt;/span>”&lt;span>，小名&lt;/span>“&lt;span>链接&lt;/span>”&lt;span>。其结构主要由三部分组成：&lt;/span>&lt;/span>&lt;/p>&lt;p style="text-align: justify">&lt;span>&lt;span>（&lt;/span>1&lt;span>）协议：如我们在网址中常见的&lt;/span>HTTP&lt;span>协议。&lt;/span>&lt;/span>&lt;/p>&lt;p style="text-align: justify">&lt;span>&lt;span>（&lt;/span>2&lt;span>）域名或者&lt;/span>IP&lt;span>地址：域名，如：&lt;/span>www.baidu.com&lt;span>，&lt;/span>IP&lt;span>地址，即将域名解析后对应的&lt;/span>IP&lt;span>。&lt;/span>&lt;/span>&lt;/p>&lt;p style="text-align: justify">&lt;span>&lt;span>（&lt;/span>3&lt;span>）路径：即目录或者文件等。&lt;/span>&lt;/span>&lt;/p>&lt;section data-id="us538906" style="text-align: justify">&lt;section>&lt;section data-width="100%">&lt;section data-brushtype="text">&lt;strong>urllib开发最简单的爬虫&lt;/strong>&lt;/section>&lt;/section>&lt;/section>&lt;/section>&lt;h2 style="text-align: justify">&lt;strong>（1）urllib简介&lt;/strong>&lt;/h2>&lt;p style="text-align: justify">&lt;span class="bannerfix-wrapper" style="text-align: center">&lt;img data-s="300,640" data-type="png" data-src="//qqpublic.qpic.cn/qq_public/0/0-2934665086-C4DD3D1B4A848A0F5D9739358CE38612/0?fmt=png&amp;size=12&amp;rs=9-8&amp;h=202&amp;w=837&amp;ppv=1" data-ratio="0.24133811230585425" data-w="837" src="https://pangyd.com/uploads/2017/09/1b8214ac44494614.jpg" data-fail="0" data-ueid="266081" width="837" height="auto" data-width="837" data-height="202" data-org="https://mmbiz.qpic.cn/mmbiz_png/Mzws9oBx0P7kQpiaL4oQG7TZxbZ6hwFdlbAnCoicvLvF2aLKfpCqp6NaztGRzkTQvN6LRN0av2u6XVBjA2N1b7LA/0.png?wxfrom=5&amp;wx_lazy=1" data-lazy="0">&lt;/span>&lt;/p></description></item><item><title>正确学习Python的姿势</title><link>https://pangyd.com/post/33-python/</link><pubDate>Sat, 05 Aug 2017 17:07:32 +0800</pubDate><guid>https://pangyd.com/post/33-python/</guid><description>&lt;section data-role="outer" label="Powered by 135editor.com">&lt;p>&lt;span>&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 想学Python，刚开始有没有觉得无从下手呢？其实Python的基础知识点，并不多，但是一定要吃透，因为这是为后续核心的学习打下一个良好的基础。俗话说：万丈高楼平地起！&lt;/span>&lt;br>&lt;/p>&lt;/section>&lt;p>&lt;span>&lt;/span>&lt;/p>&lt;p>&lt;img data-s="300,640" data-type="png" data-src="https://pangyd.com/uploads/2017/08/74c10f869f038762.jpg" class="" data-ratio="2.010178117048346" data-w="393" _width="100%" src="https://pangyd.com/uploads/2017/08/74c10f869f038762.jpg" data-fail="0">&lt;/p>&lt;p>&lt;span>&lt;strong>1、初识庐山真面目-初识Python&lt;/strong>&lt;/span>&lt;/p>&lt;p>&lt;br>&lt;/p>&lt;p>&lt;img data-s="300,640" data-type="png" data-src="https://pangyd.com/uploads/2017/08/74c10f869f038762.jpg" class="" data-ratio="0.2401263823064771" data-w="633" _width="100%" src="https://pangyd.com/uploads/2017/08/74c10f869f038762.jpg" data-fail="0">&lt;/p>&lt;p>&lt;br>&lt;/p>&lt;p>&lt;strong>学习重点：&lt;/strong>&lt;/p>&lt;p>&lt;br>&lt;/p>&lt;p>Python的安装及配置：到官网上下载Python，然后安装。安装后还要进行PATH变量的配置。同时安装2和3的环境变量配置，在cmd命令行中输入Python对安装的结果进行检验。&lt;/p>&lt;p>&lt;br>&lt;/p>&lt;p>&lt;span>&lt;strong>2、再识庐山真面目-简单Python程序（注重对Python的理解）&lt;/strong>&lt;/span>&lt;/p>&lt;p>&lt;br>&lt;/p>&lt;p>&lt;img data-s="300,640" data-type="png" data-src="https://pangyd.com/uploads/2017/08/74c10f869f038762.jpg" class="" data-ratio="0.6308411214953271" data-w="642" _width="100%" src="https://pangyd.com/uploads/2017/08/74c10f869f038762.jpg" data-fail="0">&lt;/p>&lt;p>&lt;br>&lt;/p>&lt;p>&lt;strong>学习重点：&lt;/strong>&lt;/p>&lt;p>&lt;br>&lt;/p>&lt;p>Python基础中的基础，都是重点！&lt;/p>&lt;p>&lt;br>&lt;/p>&lt;p>不可不知的数据类型（注重编程能力）&lt;/p>&lt;h1>3、不可不知的数据类型（注重编程能力）&lt;/h1>&lt;p>&lt;img data-s="300,640" data-type="png" data-src="https://pangyd.com/uploads/2017/08/74c10f869f038762.jpg" class="" data-ratio="0.7706237424547284" data-w="497" _width="100%" src="https://pangyd.com/uploads/2017/08/74c10f869f038762.jpg" data-fail="0">&lt;br>&lt;/p>&lt;p>&lt;br>&lt;/p>&lt;p>&lt;strong>学习重点：&lt;/strong>&lt;/p>&lt;p>&lt;br>&lt;/p>&lt;p>1、基本数据类型、数据类型的转换&lt;/p>&lt;p>&lt;br>&lt;/p>&lt;p>2、控制流程、if、if elif、for循环、while循环&lt;/p>&lt;p>&lt;br>&lt;/p>&lt;p>3、函数&lt;/p>&lt;p>&lt;br>&lt;/p>&lt;p>面向对象面向君，不负代码不负卿（设计思想）&lt;/p>&lt;p>&lt;br>&lt;/p>&lt;h1>面向对象面向君，不负代码不负卿（设计思想）&lt;/h1>&lt;p>&lt;img data-s="300,640" data-type="png" data-src="https://pangyd.com/uploads/2017/08/74c10f869f038762.jpg" class="" data-ratio="0.7706237424547284" data-w="497" _width="100%" src="https://pangyd.com/uploads/2017/08/74c10f869f038762.jpg" data-fail="0">&lt;/p></description></item></channel></rss>