2023教师节

今天是2023年9月10日,是所有老师的节日——教师节。

感谢曾倩老师 龙光森老师 韦佳利老师 黄佩玲老师 李洁老师 林生业老师 黄海老师 劳永进老师 罗满琼老师 钟洁老师 周静轩老师 江英球老师 颜良霞老师 白振兴老师 庞惠文老师 梁超源老师 叶子斌老师

三年来的教育,每一堂课都是一份收获。

还要感谢刘靖华老师 莫冰老师 卜肖宁老师 吴壮盛老师 莫贻秋老师

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
68
69
70
71
72
73
74
# -*- coding: utf-8 -*-

import turtle
import requests
from urllib.parse import quote
import re


def obtain_coordinate(target_word):
"""
获取汉字的坐标
:param target_word:
:return:
"""
url = "https://bihua.bmcx.com/web_system/bmcx_com_www/system/file/bihua/get_0/"

params = {
'font': quote(target_word).replace("%", "").lower(),
'shi_fou_zi_dong': '1',
'cache_sjs1': '20031914',
}
response = requests.get(url, params=params)
content = response.text
content = content.replace('hzbh.main(', '').split(');document.getElementById')[0]
content = content.split('{')[-1].split("}")[0]
pattern = re.compile(r'\w:\[(.+?)\]')
result = re.split(pattern, content)
order_xy_routine = []
words_cnt = 0
for r in result:
sec = re.findall(r'\'.+?\'', r)
if len(sec):
orders = sec[1].split('#')
for order in orders:
order_str = re.findall(r'\(\d+,\d+\)', order)
order_xy = [eval(xy) for xy in order_str]
order_xy_routine.append(order_xy)
words_cnt += 1
print(order_xy_routine)
return order_xy_routine

def draw_words(target_words, startx, starty, lineNum=1): # 画汉字
"""
画汉字
:param target_words:
:param startx:
:param starty:
:param lineNum:
:return:
"""
turtle.color("black", "black")
turtle.pu()
coordinates = obtain_coordinate(target_words)
for index, coordinate in enumerate(coordinates):
turtle.goto((startx + coordinate[0][0])/2, -(starty + coordinate[0][1])/2)
turtle.pd()
for xy in coordinate:
x,y=xy
turtle.goto((startx+x)/2, -(starty+y)/2)
turtle.pu()



if __name__ == '__main__':
turtle.screensize(2400,1300)
#画汉字
word = "教师节快乐"
draw_words(word[0], -1600, 0)
draw_words(word[1], -800, 0)
draw_words(word[2], 0, 0)
draw_words(word[3], 800, 0)
draw_words(word[4], 1600, 0)

turtle.done()

谨用这些代码,来表达我的感激之情

祝老师们

​ 黄文林

​ 2023年9月10日


2023教师节
https://blog.windeling.com/20230909f05ed6fa/
作者
黄文林
发布于
2023年9月10日
更新于
2025年5月7日
许可协议