庆祝中国共产党成立100周年

中国人民是崇尚正义、不畏强暴的人民,中华民族是具有强烈民族自豪感和自信心的民族。中国人民从来没有欺负、压迫、奴役过其他国家人民,过去没有,现在没有,将来也不会有。同时,中国人民也绝不允许任何外来势力欺负、压迫、奴役我们,谁妄想这样干,必将在14亿多中国人民用血肉筑成的钢铁长城面前碰得头破血流!

​ ——习近平

Turtle绘制党旗

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import turtle

turtle.fillcolor("red")
turtle.pencolor("red")
turtle.up()
turtle.goto(-300, 300)
turtle.down()
turtle.begin_fill()
for i in range(2):
turtle.forward(600)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.end_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
turtle.up()
turtle.goto(10, 220)
turtle.seth(225)
turtle.down()
turtle.begin_fill()
turtle.fd(125)
turtle.right(90)
turtle.fd(50)
turtle.right(90)
turtle.fd(100)
turtle.right(90)
turtle.circle(25, 90)
turtle.end_fill()
turtle.up()
turtle.goto(-40, 190)
turtle.seth(-45)
turtle.down()
turtle.begin_fill()
for i in range(2):
turtle.forward(200)
turtle.right(90)
turtle.forward(30)
turtle.right(90)
turtle.end_fill()
turtle.up()
turtle.goto(-100, 100)
turtle.seth(-50)
turtle.down()
turtle.begin_fill()
turtle.circle(100, 180)
turtle.fd(20)
turtle.right(157)
turtle.circle(-115, 190)
turtle.left(90)
turtle.fd(20)
turtle.right(90)
turtle.fd(20)
turtle.right(90)
turtle.fd(20)
turtle.left(80)
turtle.fd(30)
turtle.end_fill()
turtle.up()
turtle.goto(-90, 50)
turtle.down()
turtle.begin_fill()
turtle.circle(20)
turtle.end_fill()
turtle.hideturtle()

turtle.mainloop()

总书记讲话词云

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from random import randint

import jieba
import wordcloud
from imageio import imread


def random_color_func(word=None, font_size=None, position=None,
orientation=None, font_path=None, random_state=None):
h = randint(0, 60)
s = int(100.0 * 255.0 / 255.0)
l = int(50.0 * 255.0 / 255.0)
return "hsl({}, {}%, {}%)".format(h, s, l)


mask = imread("党徽.png")
f = open("讲话.txt", "r", encoding="utf-8")
t = f.read()
f.close()
ls = jieba.lcut(t)
txt = " ".join(ls)
w = wordcloud.WordCloud(mask=mask,
font_path="PingFang.ttc",
width=562,
height=562,
background_color="white",
color_func=random_color_func,
collocations=False,
scale=8)
w.generate(txt)
w.to_file("讲话词云.png")

辅助文件

字体:PingFang.ttc

轮廓图:党徽.png

讲话全文:讲话.txt