<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Python &#8211; 君子不器</title>
	<atom:link href="https://www.colinjiang.com/archives/tag/python/feed" rel="self" type="application/rss+xml" />
	<link>https://www.colinjiang.com</link>
	<description>Colin Jiang的博客</description>
	<lastBuildDate>Fri, 11 Jun 2021 15:23:14 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>《看漫画学Python：有趣、有料、好玩、好用》读书笔记</title>
		<link>https://www.colinjiang.com/archives/after-reading-learn-python-from-comics.html</link>
					<comments>https://www.colinjiang.com/archives/after-reading-learn-python-from-comics.html#comments</comments>
		
		<dc:creator><![CDATA[Colin]]></dc:creator>
		<pubDate>Sun, 30 May 2021 11:22:23 +0000</pubDate>
				<category><![CDATA[读书笔记]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://www.colinjiang.com/?p=6150</guid>

					<description><![CDATA[一、信息 [210529]《看漫画学Python：有趣、有料、好玩、好用》 / 作者: 关东升 / 电子工业出 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">一、信息</h3>



<ul class="wp-block-list"><li class="">[210529]《看漫画学Python：有趣、有料、好玩、好用》 / 作者: 关东升 / 电子工业出版社</li><li class="">2021阅读目标达成：15/36</li></ul>



<h3 class="wp-block-heading">二、简评</h3>



<p class="wp-block-paragraph">以往的编程书都是很枯燥，很抽象，看着看着就放弃了。这本书非常生动形象，一气呵成看完了，还有很多代码示例辅助讲解，插图形式更加易读，更加刺激大脑的记忆。&nbsp;虽然书中有点小错误，但是整体还是值得一读。</p>



<h3 class="wp-block-heading">三、选书理由</h3>



<p class="wp-block-paragraph">Python只买过那本经典的埃里克·马瑟斯《Python编程 从入门到实践》，从基础知识到项目，讲的很详尽，但太“教材”了。最近公司培训讲的python课，PPT课件展示了内容要点，但又过于简略，缺少很多内容，老师还不怎么喜欢用python推荐的规范（比如不用.format()而还是用%）。这本书则介于中间，讲的比较全面，同时配了很多针对于新手的解读（漫画形式），很多抽象难懂的东西可以更容易理解了。</p>



<h3 class="wp-block-heading">四、笔记</h3>



<h4 class="wp-block-heading">1.目录</h4>



<figure class="wp-block-image size-large"><a href="https://www.colinjiang.com/wp-content/uploads/2021/05/714b04b28bff41eea03aafbb6d50807d.jpg"><img decoding="async" src="https://www.colinjiang.com/wp-content/uploads/2021/05/714b04b28bff41eea03aafbb6d50807d.jpg" alt="" class="wp-image-6151"/></a></figure>



<h4 class="wp-block-heading">2.教学视频</h4>



<p class="wp-block-paragraph">本书配套网易云课堂：<a rel="noreferrer noopener" href="https://study.163.com/course/courseMain.htm?courseId=1210807849" target="_blank">https://study.163.com/course/courseMain.htm?courseId=1210807849</a></p>



<h4 class="wp-block-heading">3.电子书</h4>



<p class="wp-block-paragraph">百度网盘：<a rel="noreferrer noopener" href="https://pan.baidu.com/s/1tLfoZDVJDyflrXZFJndgNw" target="_blank">https://pan.baidu.com/s/1tLfoZDVJDyflrXZFJndgNw</a> 提取码：9f1m  </p>



<p class="wp-block-paragraph">蓝奏云：:<a rel="noreferrer noopener" href="https://damobao.lanzoux.com/iDrqti3by8j" target="_blank">https://damobao.lanzoux.com/iDrqti3by8j</a></p>



<h3 class="wp-block-heading">五、Python学习资料</h3>



<ul class="wp-block-list"><li>Anaconda下载：<a rel="noreferrer noopener" href="https://www.anaconda.com/products/individual" target="_blank">https://www.anaconda.com/products/individual</a></li><li>PyCharm下载：<a rel="noreferrer noopener" href="https://www.jetbrains.com/pycharm/download/" target="_blank">https://www.jetbrains.com/pycharm/download/</a></li><li>黑马程序员Python教程_600集Python从入门到精通教程（懂中文就能学会）<a rel="noreferrer noopener" href="https://www.bilibili.com/video/BV1ex411x7Em" target="_blank">https://www.bilibili.com/video/BV1ex411x7Em</a></li><li>正则表达式入门：<a rel="noreferrer noopener" href="https://github.com/ziishaned/learn-regex/blob/master/translations/README-cn.md" target="_blank">https://github.com/ziishaned/learn-regex/blob/master/translations/README-cn.md</a></li><li>break the ice with python:<a href="https://github.com/darkprinx/break-the-ice-with-python" target="_blank" rel="noreferrer noopener">https://github.com/darkprinx/break-the-ice-with-python</a></li></ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.colinjiang.com/archives/after-reading-learn-python-from-comics.html/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>《让工作化繁为简：用Python实现办公自动化》读书笔记</title>
		<link>https://www.colinjiang.com/archives/after-reading-simplify-the-work-using-python-to-realize-office-automation.html</link>
					<comments>https://www.colinjiang.com/archives/after-reading-simplify-the-work-using-python-to-realize-office-automation.html#comments</comments>
		
		<dc:creator><![CDATA[Colin]]></dc:creator>
		<pubDate>Sun, 30 May 2021 09:35:58 +0000</pubDate>
				<category><![CDATA[读书笔记]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://www.colinjiang.com/?p=6145</guid>

					<description><![CDATA[一、信息 [210526]《让工作化繁为简：用Python实现办公自动化》 / 作者: 李杰臣 / 机械工业出 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">一、信息</h3>



<ul class="wp-block-list"><li class="">[210526]《让工作化繁为简：用Python实现办公自动化》 / 作者: 李杰臣 / 机械工业出版社</li><li class="">2021阅读目标达成：14/36</li></ul>



<h3 class="wp-block-heading">二、简评</h3>



<p class="wp-block-paragraph">这本书提供了很多日常办公的代码，可以拿来直接套用，可以极大地提升工作效率。适合稍微有一点python基础的人用。 </p>



<h3 class="wp-block-heading">三、选书理由</h3>



<p class="wp-block-paragraph">Python是在非程序员界最火的一门语言，各种python的0基础培训充斥互联网，可能因为语法简单，第三方库较多，上手较快。之前想自学，但是没有坚持下来。正好今年公司给我们网课培训python，我从头到尾跟着学习了一遍，感觉理解更加深入了一些。Python对于日常电脑办公效率提升还是比较有帮助的，也有很多现成的代码可以直接套用。在微信读书上正好找到这边提供很多具体实例和代码的书，就利用坐飞机的时间通读了一遍。</p>



<h3 class="wp-block-heading">四、主要实例</h3>



<h4 class="wp-block-heading">自动化整理计算机文件</h4>



<ul class="wp-block-list"><li>文件的自动分类</li><li>文件和文件夹的快速查找</li><li>自动清理重复文件</li><li>批量转换图片的格式</li><li>按照日期自动分类图片</li></ul>



<h4 class="wp-block-heading">自动化处理PDF文件</h4>



<ul class="wp-block-list"><li>批量下载PDF文件</li><li>批量合并PDF文件</li><li>批量拆分PDF文件</li><li>批量加密PDF文件</li><li>批量为PDF文件添加水印</li></ul>



<h4 class="wp-block-heading">自动化处理Word文档</h4>



<ul class="wp-block-list"><li>批量生成Word合同</li><li>将Word文档批量转换为PDF文件</li><li>在Word文档中批量标记关键词</li><li>在Word文档中批量替换关键词</li></ul>



<h4 class="wp-block-heading">自动化处理Excel工作簿</h4>



<ul class="wp-block-list"><li>批量生成产品出货清单</li><li>批量替换工作簿的单元格数据</li><li>将多个工作表合并为一个工作表</li><li>将一个工作表拆分为多个工作簿</li><li>批量拆分列数据</li><li>批量分类汇总数据</li></ul>



<h4 class="wp-block-heading">自动化处理PowerPoint演示文稿</h4>



<ul class="wp-block-list"><li>批量提取演示文稿中的文本内容</li><li>将演示文稿批量导出为图片和PDF文件</li><li>自动读取图文素材制作演示文稿</li><li>批量提取演示文稿中的图片素材</li></ul>



<h4 class="wp-block-heading">爬虫技术基础</h4>



<ul class="wp-block-list"><li>认识网页结构</li><li>Requests模块</li><li>正则表达式</li><li>Selenium模块</li></ul>



<h4 class="wp-block-heading">爬虫实战演练</h4>



<ul class="wp-block-list"><li>爬取图书数据——当当网</li><li>爬取新闻数据——新浪新闻</li><li>爬取价格数据——农业农村部网站</li><li>爬取职位数据——前程无忧网</li><li>爬取财务报表——东方财富网</li></ul>



<h4 class="wp-block-heading">自动化处理电子邮件</h4>



<ul class="wp-block-list"><li>自动发送电子邮件</li><li>批量发送电子邮件</li><li>定时发送电子邮件</li></ul>



<p class="wp-block-paragraph"> </p>



<h2 class="wp-block-heading">五、代码</h2>



<p class="wp-block-paragraph">百度网盘链接：<a rel="noreferrer noopener" href="https://pan.baidu.com/share/init?surl=_O8bVwWQcNG0WmmLCw8V6A" target="_blank">https://pan.baidu.com/share/init?surl=_O8bVwWQcNG0WmmLCw8V6A</a> 提取码：vsim</p>



<p class="wp-block-paragraph">有需要的可以自取。看不懂代码的可以看一下书中的解读。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.colinjiang.com/archives/after-reading-simplify-the-work-using-python-to-realize-office-automation.html/feed</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>正则表达式入门基础</title>
		<link>https://www.colinjiang.com/archives/regular-expression-basic-introduction.html</link>
					<comments>https://www.colinjiang.com/archives/regular-expression-basic-introduction.html#respond</comments>
		
		<dc:creator><![CDATA[Colin]]></dc:creator>
		<pubDate>Thu, 31 Jan 2019 14:07:31 +0000</pubDate>
				<category><![CDATA[软件代码]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">http://www.colinjiang.com/?p=2598</guid>

					<description><![CDATA[一、概念 正则表达式，（英语：Regular Expression，在代码中常简写为regex、regexp或 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">一、概念</h3>



<p class="wp-block-paragraph">正则表达式，（英语：Regular Expression，在代码中常简写为regex、regexp或RE 。正则这个词语比较难懂，但是英文regular是规则、规律，所以就比较好理解了，就是用一个规则的表达式来寻找、替换文本。</p>



<h3 class="wp-block-heading">二、用途</h3>


<p>有的时候我们需要在文档中寻找某个字符串，或某种类型的字符串。如果简单的查找某个字符，我们用Ctrl+F就好了，如果数据量很多，或者我们需要将某一类特征的字符串都找到，那就不行了。这时候，正则表达式就派上用场了。概括几点<sup>1</sup>：</p>


<ul class="wp-block-list"><li> 测试字符串内的模式。 </li><li> 替换文本 </li><li> 从字符串中提取子字符串 </li></ul>



<h3 class="wp-block-heading">三、语法</h3>



<p class="wp-block-paragraph">正则表达式是由普通字符（例如字符 a 到 z）以及特殊字符（称为&#8221;元字符&#8221;）组成。详细语法可参考：http://www.runoob.com/regexp/regexp-syntax.html。常用规则如下<sup>2,3</sup>：</p>



<table class="wp-block-table"><tbody><tr><td>\</td><td>转义符，例如\?</td></tr><tr><td>^</td><td>字符串起始</td></tr><tr><td>$</td><td>字符串结束</td></tr><tr><td>*</td><td>匹配前面子表达式0次或多次</td></tr><tr><td>+</td><td>匹配前面子表达式1次或多次</td></tr><tr><td>?</td><td>匹配前面子表达式0次或1次</td></tr><tr><td>{n,m}</td><td>匹配至少n次，最多m次</td></tr><tr><td>.</td><td>匹配除\n之外的单个字符</td></tr><tr><td>(pattern)</td><td>匹配并获取这个匹配，例如匹配ab(cd)e正则表达式只返回cd</td></tr><tr><td>[xyz]</td><td>字符集合，匹配任意合集里的字符</td></tr><tr><td>[^xyz]</td><td>排除集合里的字符，不能匹配</td></tr><tr><td>\d</td><td>匹配一个数字，等价[0-9]</td></tr><tr><td>\b</td><td>匹配单词的开始或结束</td></tr></tbody></table>



<h3 class="wp-block-heading">四、简单实例</h3>



<h4 class="wp-block-heading">1 – 年份匹配<sup>4</sup>。</h4>



<p class="wp-block-paragraph">我们来看看另外一个简单的例子——匹配二十或二十一世纪中任何有效的一年。</p>



<pre class="wp-block-code"><code>\b(19|20)\d{2}\b</code></pre>



<p class="wp-block-paragraph">

我们使用<code>\b</code>而不是<code>^</code>和<code>$</code>来开始和结束这个正则表达式。<code>\b</code>表示单词边界，或两个单词之间的空格。这允许我们在文本块（而不是代码行）中匹配年份，这对于搜索如段落文本非常有用。

</p>



<h4 class="wp-block-heading">  2 – 匹配时间 </h4>



<p class="wp-block-paragraph">

现在我们要定义一个正则表达式来匹配24小时格式（MM：HH，如16:59）的任何时间。

</p>



<pre class="wp-block-code"><code>\b([01]?[0-9]|2[0-3]):([0-5]\d)\b</code></pre>



<h4 class="wp-block-heading"> 3 – 匹配日期 </h4>



<p class="wp-block-paragraph">现在我们来匹配一个<code>DAY/MONTH/YEAR</code>样式的日期模式。 </p>



<pre class="wp-block-code"><code>\b(0?[1-9]|[12]\d|3[01])([\/\-])(0?[1-9]|1[012])\2(\d{4})</code></pre>



<p class="wp-block-paragraph"> 常用的一些正则表达式:<a href="https://c.runoob.com/front-end/854" target="_blank" rel="noopener">http://www.runoob.com/regexp/regexp-syntax.html </a></p>



<h4 class="wp-block-heading">参考文献</h4>



<ol class="wp-block-list"><li>菜鸟教程．正则表达式[OL]http://www.runoob.com/regexp/regexp-tutorial.html</li><li>小象学院．Python爬虫工程师·初级[OL] http://www.chinahadoop.cn，2019</li><li> deerchao．正则表达式30分钟入门教程[OL]http://www.deerchao.net/tutorials/regex/regex.htm</li><li>Patrick Triest. YOU SHOULD LEARN REGEX[OL]https://blog.patricktriest.com/you-should-learn-regex/, 2017<br>   译文：你应该学习正则表达式[OL] http://www.codeceo.com/article/you-should-learn-regex.html</li></ol>
]]></content:encoded>
					
					<wfw:commentRss>https://www.colinjiang.com/archives/regular-expression-basic-introduction.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>python代码画出心形</title>
		<link>https://www.colinjiang.com/archives/draw-heart-shape-with-python.html</link>
					<comments>https://www.colinjiang.com/archives/draw-heart-shape-with-python.html#respond</comments>
		
		<dc:creator><![CDATA[Colin]]></dc:creator>
		<pubDate>Sat, 26 Jan 2019 16:16:38 +0000</pubDate>
				<category><![CDATA[软件代码]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[code]]></category>
		<guid isPermaLink="false">http://www.colinjiang.com/?p=2444</guid>

					<description><![CDATA[用一行python代码，在命令提示符界面下画心。 规范的代码如下： 用turtle画心]]></description>
										<content:encoded><![CDATA[
<h4 class="wp-block-heading">用一行python代码，在命令提示符界面下画心。</h4>



<pre class="wp-block-code"><code>print('\n'.join([''.join([('Love'[(x-y) % len('Love')] if ((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3 &lt;= 0 else ' ') for x in range(-30, 30)]) for y in range(30, -30, -1)]))</code></pre>



<p class="wp-block-paragraph">规范的代码如下：</p>



<pre class="wp-block-code"><code>print(
    '\n'.join
        ([
        ''.join
            ([
                (
                    'Love'[(x-y) % len('Love')]
                    if ((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3 &lt;= 0 
                   else ' '
                )   for x in range(-30, 30)
            ])
                for y in range(30, -30, -1)
        ])
     )
</code></pre>



<h4 class="wp-block-heading">用turtle画心</h4>



<pre class="wp-block-code"><code>import turtle
import time

# 曲线移动
def curveMove():
    for i in range(200):
        turtle.right(1)
        turtle.forward(1)


def drawHeart():
    turtle.speed(10) # 画笔速度调到最高
    turtle.color('red','pink')
    turtle.begin_fill()
    turtle.left(140) # 逆时针旋转140度
    turtle.forward(111.65) # 向前移动111.65个像素
    curveMove() # 画曲线
    turtle.left(120) # 逆时针旋转120度
    curveMove() # 继续画曲线
    turtle.forward(111.65) # 向前移动111.65个像素
    turtle.end_fill()
    time.sleep(10)

if __name__ == '__main__':
    drawHeart()</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.colinjiang.com/archives/draw-heart-shape-with-python.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>小猪佩奇python代码</title>
		<link>https://www.colinjiang.com/archives/python-code-of-peppa-pig.html</link>
					<comments>https://www.colinjiang.com/archives/python-code-of-peppa-pig.html#respond</comments>
		
		<dc:creator><![CDATA[Colin]]></dc:creator>
		<pubDate>Sun, 13 Jan 2019 11:16:52 +0000</pubDate>
				<category><![CDATA[软件代码]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[code]]></category>
		<guid isPermaLink="false">http://www.colinjiang.com/?p=2280</guid>

					<description><![CDATA[不到两岁的女儿最喜欢小猪佩奇，话都说不明白但是会说peppa pig，足以见得这只猪的魅力。最近也是在学习py [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">不到两岁的女儿最喜欢小猪佩奇，话都说不明白但是会说peppa pig，足以见得这只猪的魅力。最近也是在学习python，所以找到这个代码，一来运行下哄女儿开心，二来也是再复习下python的语法。</p>



<h4 class="wp-block-heading">main.py</h4>



<pre class="wp-block-code"><code>import os, sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
import turtle as t
from nose import draw_nose
import head
import ear
import eyes
import face
import mouth
import body
import hands
from legs import draw_legs
from tail import draw_tail



def main():
    """
    主函数
    :return: null
    """
    t.pensize(4)
    t.colormode(255)
    t.color((255, 155, 192), "pink")
    t.setup(840, 500)
    t.speed(10)

    draw_nose()
    head.draw_head()
    ear.draw_ear()
    eyes.draw_eyes()
    face.draw_face()
    mouth.draw_mouth()
    body.draw_body()
    hands.draw_hands()
    draw_legs()
    draw_tail()
    t.exitonclick()


if __name__ == '__main__':
    main()
</code></pre>



<h4 class="wp-block-heading">body.py</h4>



<pre class="wp-block-code"><code># coding: utf-8

import turtle as t


def draw_body():
    """
    画小猪佩奇的身体
    :return: null
    """
    t.color((255, 99, 71), "red")
    t.pu()
    t.seth(90)
    t.fd(-20)
    t.seth(0)
    t.fd(-78)
    t.pd()
    t.begin_fill()
    t.seth(-130)
    t.circle(100, 10)
    t.circle(300, 30)
    t.seth(0)
    t.fd(230)
    t.seth(90)
    t.circle(300, 30)
    t.circle(100, 3)
    t.color((255, 155, 192), (255, 100, 100))
    t.seth(-135)
    t.circle(-80, 63)
    t.circle(-150, 24)
    t.end_fill()</code></pre>



<span id="more-2280"></span>



<h4 class="wp-block-heading">ear.py</h4>



<pre class="wp-block-code"><code># coding:  utf-8

import turtle as t


def draw_ear():
    """
    画小猪佩奇的耳朵
    :return:
    """
    t.color((255, 255, 192), "pink")
    t.pu()
    t.seth(90)
    t.fd(-7)
    t.seth(0)
    t.fd(70)
    t.pd()
    t.begin_fill()
    t.seth(100)
    t.circle(-50, 50)
    t.circle(-10, 120)
    t.circle(-50, 54)
    t.end_fill()
    t.pu()
    t.seth(90)
    t.fd(-12)
    t.seth(0)
    t.fd(30)
    t.pd()
    t.begin_fill()
    t.seth(100)
    t.circle(-50, 50)
    t.circle(-10, 120)
    t.circle(-50, 56)
    t.end_fill()</code></pre>



<h4 class="wp-block-heading">eyes.py</h4>



<pre class="wp-block-code"><code># coding: utf-8

import turtle as t

def draw_eyes():
    """
    画小猪佩奇的眼睛
    :return:
    """
    t.color((255, 155, 192), "white")
    t.pu()
    t.seth(90)
    t.fd(-20)
    t.seth(0)
    t.fd(-95)
    t.pd()
    t.begin_fill()
    t.circle(15)
    t.end_fill()
    t.color("black")
    t.pu()
    t.seth(90)
    t.fd(12)
    t.seth(0)
    t.fd(-3)
    t.pd()
    t.begin_fill()
    t.circle(3)
    t.end_fill()
    t.color((255, 155, 192), "white")
    t.pu()
    t.seth(90)
    t.fd(-25)
    t.seth(0)
    t.fd(40)
    t.pd()
    t.begin_fill()
    t.circle(15)
    t.end_fill()
    t.color("black")
    t.pu()
    t.seth(90)
    t.fd(12)
    t.seth(0)
    t.fd(-3)
    t.pd()
    t.begin_fill()
    t.circle(3)
    t.end_fill()</code></pre>



<h4 class="wp-block-heading">face.py</h4>



<pre class="wp-block-code"><code># coding: utf-8
import turtle as t

def draw_face():
    """
    画小猪佩奇的脸
    :return:
    """
    t.color((255, 155, 192))
    t.pu()
    t.seth(90)
    t.fd(-95)
    t.seth(0)
    t.fd(65)
    t.pd()
    t.begin_fill()
    t.circle(30)
    t.end_fill()</code></pre>



<h4 class="wp-block-heading">hands.py</h4>



<pre class="wp-block-code"><code># coding: utf-8

import turtle as t


def draw_hands():
    """
    画小猪佩奇的手
    :return:
    """
    t.color((255, 155, 192))
    t.pu()
    t.seth(90)
    t.fd(-40)
    t.seth(0)
    t.fd(-27)
    t.pd()
    t.seth(-160)
    t.circle(300, 15)
    t.pu()
    t.seth(90)
    t.fd(15)
    t.seth(0)
    t.fd(0)
    t.pd()
    t.seth(-10)
    t.circle(-20, 90)
    t.pu()
    t.seth(90)
    t.fd(30)
    t.seth(0)
    t.fd(237)
    t.pd()
    t.seth(-20)
    t.circle(-300, 15)
    t.pu()
    t.seth(90)
    t.fd(20)
    t.seth(0)
    t.fd(0)
    t.pd()
    t.seth(-170)
    t.circle(20, 90)</code></pre>



<h4 class="wp-block-heading">head.py</h4>



<pre class="wp-block-code"><code># coding: utf-8
import turtle as t


def draw_head():
    t.color((255, 155, 192), "pink")
    t.pu()
    t.seth(90)
    t.fd(41)
    t.seth(0)
    t.fd(0)
    t.pd()
    t.begin_fill()
    t.seth(180)
    t.circle(300, -30)
    t.circle(100, -60)
    t.circle(80, -100)
    t.circle(150, -20)
    t.circle(60,-95)
    t.seth(161)
    t.circle(-300, 15)
    t.pu()
    t.goto(-100, 100)
    t.pd()
    t.seth(-30)
    a = 0.4
    for i in range(60):
        if 0 &lt;= i &lt; 30 or 60 &lt;= i &lt;90:
            a += 0.08
            t.lt(3)
            t.fd(a)
        else:
            a -= 0.08
            t.lt(3)
            t.fd(a)
    t.end_fill()</code></pre>



<h4 class="wp-block-heading">legs.py</h4>



<pre class="wp-block-code"><code># coding: utf-8

import turtle as t


def draw_legs():
    """
    画小猪佩奇的脚
    :return:
    """
    t.pensize(10)
    t.color((240, 128, 128))
    t.pu()
    t.seth(90)
    t.fd(-75)
    t.seth(0)
    t.fd(-180)
    t.pd()
    t.seth(-90)
    t.fd(40)
    t.seth(-180)
    t.color("black")
    t.pensize(15)
    t.fd(20)
    t.pensize(10)
    t.color((240, 128, 128))
    t.pu()
    t.seth(90)
    t.fd(40)
    t.seth(0)
    t.fd(90)
    t.pd()
    t.seth(-90)
    t.fd(40)
    t.seth(-180)
    t.color("black")
    t.pensize(15)
    t.fd(20)</code></pre>



<h4 class="wp-block-heading">mouth.py</h4>



<pre class="wp-block-code"><code># coding: utf-8

import turtle as t


def draw_mouth():
    """
    画小猪佩奇的嘴
    :return: null
    """
    t.color((239, 69, 19))
    t.pu()
    t.seth(90)
    t.fd(15)
    t.seth(0)
    t.fd(-100)
    t.pd()
    t.seth(-80)
    t.circle(30, 40)
    t.circle(40, 80)</code></pre>



<h4 class="wp-block-heading">nose.py</h4>



<pre class="wp-block-code"><code># coding: utf-8
import turtle as t


def draw_nose():
    t.pu()
    t.goto(-100, 100)
    t.pd()
    t.seth(-30)
    t.begin_fill()
    a = 0.4
    for i in range(120):
        if 0 &lt;= i &lt; 30 or 60 &lt;= i &lt; 90:
            a = a+0.08
            t.lt(3)
            t.fd(a)
        else:
            a = a-0.08
            t.lt(3)
            t.fd(a)
    t.end_fill()
    t.pu()
    t.seth(90)
    t.fd(25)
    t.seth(0)
    t.fd(10)
    t.pd()
    t.pencolor(255, 155, 192)
    t.seth(10)
    t.begin_fill()
    t.circle(5)
    t.color(160, 82, 45)
    t.end_fill()
    t.pu
    t.seth(0)
    t.fd(20)
    t.pd()
    t.pencolor(255, 155, 192)
    t.seth(10)
    t.begin_fill()
    t.circle(5)
    t.color(160, 82,45)
    t.end_fill()</code></pre>



<h4 class="wp-block-heading">tail.py</h4>



<pre class="wp-block-code"><code># coding: utf-8

import turtle as t


def draw_tail():
    """
    画小猪佩奇的尾巴
    :return: null
    """
    t.pensize(4)
    t.color((255, 155, 192))
    t.pu()
    t.seth(90)
    t.fd(70)
    t.seth(0)
    t.fd(95)
    t.pd()
    t.seth(0)
    t.circle(70, 20)
    t.circle(10, 330)
    t.circle(70, 30)</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.colinjiang.com/archives/python-code-of-peppa-pig.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>第一条python爬虫代码</title>
		<link>https://www.colinjiang.com/archives/first-spider-code-python.html</link>
					<comments>https://www.colinjiang.com/archives/first-spider-code-python.html#respond</comments>
		
		<dc:creator><![CDATA[Colin]]></dc:creator>
		<pubDate>Fri, 11 Jan 2019 15:02:09 +0000</pubDate>
				<category><![CDATA[软件代码]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[code]]></category>
		<guid isPermaLink="false">http://www.colinjiang.com/?p=2273</guid>

					<description><![CDATA[学习编程，第一句都是“Hello world”。 那么，既然学习爬虫，那么记录下第一条代码：]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">学习编程，第一句都是“Hello world”。</p>



<p class="wp-block-paragraph">那么，既然学习爬虫，那么记录下第一条代码：</p>



<pre class="wp-block-code"><code>import requests

url='http://www.colinjiang.com/dh/'
resp = requests.get(url)

print(resp.content)

#保存网页
f = open('colin.html','w+',encoding='utf-8')
f.write(resp.text)
f.close()</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.colinjiang.com/archives/first-spider-code-python.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>利用GAE自建Gtalk bot发推</title>
		<link>https://www.colinjiang.com/archives/making-gtalk-bot-with-gae-for-twitter.html</link>
					<comments>https://www.colinjiang.com/archives/making-gtalk-bot-with-gae-for-twitter.html#comments</comments>
		
		<dc:creator><![CDATA[Colin]]></dc:creator>
		<pubDate>Mon, 05 Dec 2011 14:01:47 +0000</pubDate>
				<category><![CDATA[软件代码]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Google]]></category>
		<guid isPermaLink="false">http://www.colinjiang.com/?p=774</guid>

					<description><![CDATA[首先在电脑里搭建Python环境。（除此之外，GAE还支持Java） 1.下载Python并安装。下载地址：h [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>首先在电脑里搭建Python环境。（除此之外，GAE还支持Java）</p>
<p>1.下载Python并安装。下载地址：<a href="http://python.org/ftp/python/2.5.2/python-2.5.2.msi" target="_blank" rel="noopener noreferrer">http://python.org/ftp/python/2.5.2/python-2.5.2.msi</a>（For Windows）</p>
<p>配置系统变量：找到PATH变量，然后双击PATH变量的值，在后面添加“X:\Python25”（不包括引号），X:\Python25是你的Python安装地址。</p>
<p>2.下载Google App Engine SDK for Python并安装。下载地址<a href="http://googleappengine.googlecode.com/files/GoogleAppEngine-1.6.0.msi" target="_blank" rel="noopener noreferrer">http://googleappengine.googlecode.com/files/GoogleAppEngine-1.6.0.msi</a>（For Windows）More：<a href="http://code.google.com/appengine/downloads.html#Google_App_Engine_SDK_for_Python" target="_blank" rel="noopener noreferrer">http://code.google.com/appengine/downloads.html#Google_App_Engine_SDK_for_Python</a><br />
<span id="more-774"></span></p>
<p>3.按照Twitalker官方教程<a href="http://code.google.com/p/twitalker/wiki/SetupGuide" target="_blank" rel="noopener noreferrer">http://code.google.com/p/twitalker/wiki/SetupGuide</a>进行配置。</p>
<p>4.上传文件夹到GAE。</p>
<p>5.登录×××.appspot.com(***为你的Google  App ID)</p>
<p>6.OAuth验证(需翻墙)。按照提示添加机器人即可。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.colinjiang.com/archives/making-gtalk-bot-with-gae-for-twitter.html/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
