Python Turtle召唤童年:喜羊羊与灰太狼之懒羊羊绘画

Python Turtle召唤童年:喜羊羊与灰太狼之懒羊羊绘画

  • 🐸 前言 🐸
  • 🐞往期绘画🐞
  • 🐋 效果图 🐋
  • 🐉 代码 🐉

🐸 前言 🐸

小时候,每次打开电视,看到喜羊羊机智对抗灰太狼的情景,总能让人捧腹大笑,回忆满满。今天,我们用Python的turtle模块,带大家一起重温这份童年快乐!通过简单的代码与绘图,我们将把懒洋洋生动地呈现在屏幕上。

🐞往期绘画🐞

序号链接
01🦖用 Python 与 Turtle 创作属于你的“冰墩墩”!🦖
02🦖用 Python 与 Turtle 创作属于你的“雪容融”!🦖
03🦖python梦幻魔法的奥秘:百变小樱魔法阵全解析🦖
04🦖python梦幻魔法的奥秘:魔法少女全解析🦖
05🦖Python Turtle绘图:重现汤姆劈树的经典瞬间🦖
06🐿️Python Turtle召唤童年:喜羊羊与灰太狼之喜羊羊绘画🐿️
07🐿️Python Turtle召唤童年:喜羊羊与灰太狼之懒羊羊绘画🐿️

🐋 效果图 🐋

在这里插入图片描述

🐉 代码 🐉

# coding=gbkimport turtledef plotLine(points, pencolor=None, width=None, speed=None):'''功能:画折线参数:- points : 一系列点,用列表或元组表示- pencolor : 画笔颜色,默认不变- width : 画笔宽度,默认不变- speed : 绘制速度,默认不变'''# 记录旧参数oldpencolor = turtle.pencolor()oldwidth = turtle.width()oldspeed = turtle.speed()# 修改新参数if pencolor is not None:turtle.pencolor(pencolor)if width is not None:turtle.width(width)if speed is not None:turtle.speed(speed)# 绘制折线turtle.up()turtle.goto(points[0])turtle.down()for point in points[1:]:turtle.goto(point)# 恢复旧参数turtle.pencolor(oldpencolor)turtle.width(oldwidth)turtle.speed(oldspeed)def plotPoly(points, fill=False, pencolor=None, fillcolor=None,width=None, speed=None):'''功能:绘制封闭多边形'''# 保存旧参数oldfillcolor = turtle.fillcolor()# 更新新参数if fillcolor is not None:turtle.fillcolor(fillcolor)# 绘制封闭多边形points_plotline = list(points) + [points[0]]if fill:turtle.begin_fill()plotLine(points_plotline, pencolor, width, speed)turtle.end_fill()else:plotLine(points_plotline, pencolor, width, speed)# 恢复旧参数turtle.fillcolor(oldfillcolor)# 设置一些参数
turtle.setup(680, 680)
# turtle.speed(100)# 绘画# 脸部轮廓
points = [(-131, 76), (-121, 85), (-112, 94), (-105, 105),(-113, 109), (-105, 106), (-97, 106), (-89, 106), (-83, 110), (-77, 115), (-69, 120), (-60, 118), (-53, 117), (-44, 117), (-35, 120), (-26, 126), (-17, 122), (-10, 117), (-3, 114), (6, 111), (16, 110), (26, 112), (32, 115), (36, 117), (42, 112), (47, 107), (53, 102), (61, 98), (71, 96), (80, 96), (89, 97), (98, 99), (104, 92), (108, 86), (114, 78), (121, 71), (128, 66), (139, 62), (138, 53), (138, 42), (139, 32), (143, 25), (149, 17), (154, 9), (157, 6), (154, 2), (152, -1), (147, -5), (143, -12), (140, -20), (138, -28), (137, -38), (139, -46), (139, -52), (132, -57), (124, -63), (120, -70), (115, -76), (113, -86), (109, -96), (100, -103), (94, -111), (90, -119), (89, -125), (90, -131), (94, -137), (97, -142),(93, -149), (87, -150), (71, -153), (55, -156), (42, -156), (28, -157), (12, -157), (-2, -155), (-16, -153), (-27, -151), (-37, -147), (-50, -144), (-61, -140), (-71, -137), (-82, -133), (-91, -126), (-102, -119), (-112, -111), (-120, -102), (-127, -94), (-131, -89), (-136, -79), (-139, -71), (-141, -60), (-143, -49), (-141, -38), (-140, -27), (-138, -17), (-135, -8), (-132, 1), (-131, 11), (-132, 22), (-130, 33), (-129, 44), (-126, 55), (-123, 67), (-121, 76), (-121, 85)]
plotPoly(points, True, pencolor=(0.67, 0.5, 0.22),width=2, fillcolor=(1, 0.82, 0.71))# 左胳膊
points = [(93, -147), (97, -143), (102, -138), (111, -134), (119, -131), (130, -128), (143, -126), (149, -120), (158, -117), (166, -113), (175, -110), (177, -103), (182, -95), (191, -89), (199, -87), (204, -85), (210, -86), (214, -88), (217, -93), (221, -96), (224, -100), (224, -104), (223, -108), (225, -112), (226, -118), (224, -124), (219, -128), (215, -129), (210, -127), (205, -123), (208, -118), (203, -114), (203, -110), (209, -109), (213, -105),(214, -130),(206, -135), (202, -137), (197, -135), (192, -132), (187, -129), (186, -132), (180, -136), (170, -140), (162, -144), (151, -149), (139, -155), (128, -159), (118, -161), (110, -162), (104, -163), (99, -160), (94, -156), (93, -150), (95, -147)]
plotPoly(points, True, pencolor=(1, 0.82, 0.71),fillcolor=(1, 0.82, 0.71), width=2)
plotLine(points[:35], pencolor=(0.67, 0.5, 0.22), width=2)
plotLine(points[36:], pencolor=(0.67, 0.5, 0.22), width=2)
points = [(197, -119), (202, -116), (202, -111), (202, -106), (202, -102), (207, -105), (214, -104), (217, -101), (218, -99), (217, -96), (216, -93), (212, -91), (207, -88), (201, -86)]
plotLine(points, pencolor=(0.67, 0.5, 0.22), width=2)
points = [(223, -111), (219, -114), (215, -117), (210, -117), (205, -117), (203, -114)]
plotLine(points, pencolor=(0.67, 0.5, 0.22), width=2)# 右胳膊
points = [(-126, -98), (-133, -94), (-141, -90), (-146, -88), (-151, -85), (-154, -78), (-157, -72), (-162, -68), (-168, -64), (-179, -61), (-184, -59), (-189, -61), (-192, -64), (-196, -69), (-199, -73), (-201, -78), (-199, -85), (-201, -93), (-200, -98), (-196, -102), (-190, -102), (-188, -106), (-184, -108), (-179, -110), (-171, -108), (-163, -103), (-165, -106), (-157, -111), (-149, -116), (-140, -120), (-131, -125), (-118, -133), (-110, -136), (-99, -139), (-97, -136), (-97, -133), (-95, -126), (-98, -123), (-104, -118), (-111, -112), (-119, -103)]
plotPoly(points, True, pencolor=(0.67, 0.5, 0.22),fillcolor=(1, 0.82, 0.71), width=2)
points = [(-178, -62), (-185, -63), (-193, -67), (-194, -74), (-191, -79), (-186, -79), (-180, -78), (-179, -85), (-179, -88), (-178, -91), (-175, -93)]
plotLine(points, pencolor=(0.67, 0.5, 0.22), width=2)
points = [(-192, -79), (-189, -83), (-185, -85), (-180, -83), (-179, -89), (-183, -93), (-187, -91), (-192, -90), (-198, -86)]
plotLine(points, pencolor=(0.67, 0.5, 0.22), width=2)
points = [(-185, -94), (-181, -97), (-187, -102)]
plotLine(points, pencolor=(0.67, 0.5, 0.22), width=2)# 肚子
points = [(-95, -127), (-97, -135), (-96, -142), (-104, -147), (-109, -152), (-112, -156), (-116, -165), (-119, -173), (-121, -182), (-120, -188), (-117, -198), (-114, -208), (-118, -211), (-122, -218), (-123, -228), (-122, -238), (-109, -261), (-103, -266), (-103, -275), (-97, -281), (-91, -289), (-83, -292), (-74, -297), (-64, -299), (-55, -298), (-46, -295), (-40, -301), (-35, -306), (-27, -310), (-16, -312), (-8, -311), (2, -307), (6, -303), (13, -300), (20, -304), (26, -309), (34, -314), (45, -315), (55, -314), (62, -310), (70, -305), (77, -296), (89, -295), (96, -291), (103, -286), (111, -277), (113, -269), (116, -258), (116, -251), (113, -242), (119, -238), (122, -231), (125, -221), (125, -208), (123, -197), (116, -187), (116, -177), (117, -168), (117, -163), (111, -162), (102, -163), (95, -157), (93, -149), (87, -150), (78, -150), (72, -154), (60, -154), (56, -156), (54, -165), (56, -175), (54, -184), (56, -196), (53, -211), (55, -223), (54, -231), (51, -239), (44, -243), (37, -245), (34, -246), (20, -246), (5, -246), (-33, -241), (-56, -237), (-80, -233), (-90, -230), (-94, -227), (-96, -219), (-98, -210), (-95, -201), (-95, -194), (-91, -181), (-88, -163), (-82, -147), (-77, -134), (-86, -131)]
plotPoly(points, True, pencolor=(0.67, 0.5, 0.22),fillcolor=(1, 1, 1), width=2)# 衣服
points = [(56, -156), (54, -165), (56, -175), (54, -184), (56, -196), (53, -211), (55, -223), (54, -231), (51, -239), (44, -243), (37, -245), (34, -246), (20, -246), (5, -246), (-33, -241), (-56, -237), (-80, -233), (-90, -230), (-94, -227), (-96, -219), (-98, -210), (-95, -201), (-95, -194), (-91, -181), (-88, -163), (-82, -147), (-77, -134),(-71, -138), (-61, -141), (-51, -145), (-40, -147), (-31, -150), (-20, -152), (-9, -155), (1, -156), (12, -157), (22, -157), (34, -158), (46, -156)]
plotPoly(points, True, pencolor=(0.67, 0.5, 0.22),fillcolor=(0.97, 0.81, 0.31), width=2)
points = [(-96, -212), (52, -227), (52, -234), (-95, -220)]
plotPoly(points, True, pencolor=(1, 1, 1),fillcolor=(1, 1, 1), width=1)
points = [(-91, -228), (45, -240)]
plotLine(points, pencolor=(1, 1, 1), width=2)# 羊腿(右)
points = [(-107, -234), (-106, -237), (-110, -239), (-114, -238), (-120, -238), (-123, -237), (-128, -239), (-134, -240), (-142, -245), (-142, -235), (-144, -231), (-147, -224), (-148, -220), (-151, -215), (-157, -209), (-164, -204), (-171, -204), (-177, -204), (-183, -205), (-188, -206), (-191, -209), (-195, -215), (-198, -219), (-199, -224), (-199, -231), (-199, -237), (-198, -244), (-198, -249), (-195, -257), (-193, -262), (-190, -267), (-186, -274), (-181, -281), (-176, -284), (-172, -285), (-163, -286), (-157, -282), (-152, -278), (-149, -273), (-146, -268), (-139, -264), (-129, -261), (-123, -261), (-111, -259), (-101, -260), (-98, -265), (-98, -260), (-101, -258), (-101, -255), (-102, -254), (-103, -249), (-100, -245), (-104, -241)]
plotPoly(points, True, pencolor=(0.67, 0.5, 0.22),fillcolor=(1, 0.82, 0.71), width=2)
points = [(-188, -224), (-187, -219), (-186, -215), (-185, -212), (-182, -206)]
plotLine(points, pencolor=(0.67, 0.5, 0.22), width=2)
points = [(-142, -244), (-142, -249), (-143, -256), (-144, -262), (-145, -267)]
plotLine(points, pencolor=(0.67, 0.5, 0.22), width=2)# 羊腿(左)
points = [(115, -264), (123, -266), (130, -268), (135, -262), (142, -256), (151, -255), (160, -255), (165, -259), (170, -263), (175, -270), (177, -280), (180, -289), (181, -295), (180, -301), (179, -309), (175, -315), (168, -320), (162, -323), (155, -323), (147, -323), (139, -319), (135, -311), (130, -304), (129, -296), (128, -287), (132, -287), (123, -287), (115, -285), (107, -284)]
plotPoly(points, True, pencolor=(0.67, 0.5, 0.22),fillcolor=(1, 0.82, 0.71), width=2)
points = [(153, -302), (154, -309), (155, -315), (158, -320), (159, -323)]
plotLine(points, pencolor=(0.67, 0.5, 0.22), width=2)# 头
points = [(-139, -80), (-147, -76), (-151, -73), (-156, -68), (-158, -64), (-161, -59), (-164, -53), (-164, -49), (-165, -41), (-165, -36), (-169, -30), (-172, -27), (-176, -17), (-177, -12), (-178, -5), (-179, -1), (-179, 7), (-177, 16), (-175, 25), (-174, 29), (-177, 34), (-179, 41), (-181, 47), (-182, 51), (-183, 59), (-183, 64), (-181, 76), (-180, 81), (-178, 88), (-174, 94), (-169, 100), (-167, 106), (-167, 114), (-167, 123), (-165, 131), (-162, 139), (-161, 144), (-154, 151), (-150, 156), (-147, 160), (-141, 164), (-135, 168), (-132, 170), (-130, 178), (-125, 189), (-122, 195), (-117, 200), (-114, 203), (-103, 212), (-95, 215), (-81, 218), (-72, 218), (-67, 223), (-63, 226), (-55, 234), (-51, 238), (-43, 243), (-36, 246), (-27, 248), (-22, 254), (-20, 261), (-15, 265), (-9, 267), (-1, 270), (5, 276), (13, 283), (22, 284), (29, 288), (37, 288), (43, 287), (50, 291), (50, 293), (59, 297), (67, 299), (76, 302), (83, 306), (90, 312), (92, 318), (100, 314), (103, 311), (109, 307), (115, 300), (120, 293), (123, 283), (123, 278), (131, 274), (140, 271), (148, 264), (152, 256), (153, 247), (152, 242), (160, 240), (165, 233), (171, 224), (182, 217), (187, 213), (192, 207), (195, 202), (199, 195), (200, 189), (207, 187), (216, 183), (224, 179), (264, 118), (271, 112), (277, 103), (280, 93), (280, 85), (282, 77), (282, 68), (279, 60), (279, 54), (279, 44), (284, 36), (286, 27), (286, 13), (289, 3), (286, -8), (283, -15), (279, -23), (275, -30), (269, -36), (271, -42), (272, -50), (269, -57), (268, -65), (267, -69), (265, -75), (263, -80), (258, -85), (254, -91), (249, -94), (242, -102), (235, -106), (223, -111)]
plotLine(points, pencolor=(0.67, 0.5, 0.22), width=2)
points = [(-27, 248), (-24, 242), (-21, 237), (-18, 232), (-13, 229), (-9, 227), (-2, 224)]
plotLine(points, pencolor=(0.67, 0.5, 0.22), width=2)
points = [(1, 269), (6, 265), (11, 258), (16, 253), (24, 249), 
(30, 248), (37, 245), (47, 245)]
plotLine(points, pencolor=(0.67, 0.5, 0.22), width=2)
points = [(45, 286), (46, 280), (48, 275), (53, 271), (62, 267)]
plotLine(points, pencolor=(0.67, 0.5, 0.22), width=2)
points = [(123, 276), (121, 273), (115, 270), (112, 268), (105, 266), 
(98, 266)]
plotLine(points, pencolor=(0.67, 0.5, 0.22), width=2)
points = [(152, 244), (146, 239), (138, 235), (128, 236), (117, 236), 
(104, 237)]
plotLine(points, pencolor=(0.67, 0.5, 0.22), width=2)
points = [(168, 223), (168, 217), (163, 210), (159, 205), (154, 203), 
(143, 202), (137, 201), (131, 201)]
plotLine(points, pencolor=(0.67, 0.5, 0.22), width=2)# 羊角(左)
points = [(194, 169), (201, 165), (209, 171), (216, 176), (224, 181), 
(231, 184), (244, 188), (258, 192), (271, 194), (281, 194), 
(288, 192), (296, 191), (301, 189), (306, 188), (311, 185), 
(316, 182), (318, 177), (319, 172), (317, 168), (313, 163), 
(311, 160), (310, 158), (306, 153), (300, 151), (293, 148), 
(291, 145), (285, 141), (281, 139), (278, 136), (275, 132), 
(272, 127), (268, 123), (265, 118), (257, 113), (251, 105), 
(254, 102), (257, 96), (254, 102), (251, 106), (245, 109), 
(238, 105), (237, 110), (236, 118), (233, 124), (229, 129), 
(225, 131), (219, 132), (216, 132), (215, 135), (215, 139), 
(216, 148), (215, 150), (214, 154), (209, 160), (205, 162)]
plotPoly(points, True, pencolor=(0.67, 0.5, 0.22),fillcolor=(0.51, 0.37, 0.28), width=2)# 羊角(右)
points = [(-119, 201), (-122, 205), (-124, 211), (-128, 216), (-135, 223), 
(-139, 232), (-140, 240), (-141, 249), (-137, 254), (-129, 256), 
(-119, 257), (-110, 256), (-98, 253), (-90, 250), (-81, 246), 
(-74, 242), (-66, 237), (-59, 230), (-62, 225), (-71, 217), 
(-82, 217), (-94, 215), (-104, 211), (-111, 204)]
plotPoly(points, True, pencolor=(0.67, 0.5, 0.22),fillcolor=(0.51, 0.37, 0.28), width=2)# 耳朵(左)
points = [(229, 68), (233, 70), (242, 70), (250, 69), (257, 65), 
(263, 58), (269, 51), (274, 44), (278, 38), (282, 31), 
(288, 25), (294, 20), (296, 19), (293, 16), (285, 12), 
(281, 9), (274, 7), (267, 6), (262, 6), (252, 6), 
(241, 9), (234, 12), (228, 18), (221, 29), (217, 40), 
(218, 52), (220, 60), (225, 64)]
plotPoly(points, True, pencolor=(0.67, 0.5, 0.22),fillcolor=(1, 0.82, 0.72), width=2)# 耳朵(右)
points = [(-165, 112), (-174, 109), (-179, 106), (-187, 103), (-188, 101), 
(-185, 97), (-182, 91), (-178, 88), (-176, 90), (-174, 92), 
(-167, 99), (-165, 102), (-165, 108)]
plotPoly(points, True, pencolor=(0.67, 0.5, 0.22),fillcolor=(1, 0.82, 0.72), width=2)# 眼睛(右)
turtle.color((0.67, 0.5, 0.22), (1, 1, 1))
turtle.width(2)
turtle.up()
turtle.goto(-71, 8)
turtle.down()
turtle.begin_fill()
turtle.circle(30)
turtle.end_fill()turtle.pencolor((0.1, 0.1, 0.1))
turtle.up()
turtle.goto(-71, 37)
turtle.down()
turtle.dot(25)turtle.pencolor((1, 1, 1))
turtle.up()
turtle.goto((-74, 41))
turtle.down()
turtle.dot(9)# 眼睛(左)
turtle.color((0.67, 0.5, 0.22), (1, 1, 1))
turtle.up()
turtle.goto(36, -12)
turtle.down()
turtle.begin_fill()
turtle.circle(30)
turtle.end_fill()turtle.pencolor((0.1, 0.1, 0.1))
turtle.up()
turtle.goto(39, 18)
turtle.down()
turtle.dot(25)turtle.pencolor((1, 1, 1))
turtle.up()
turtle.goto((34, 22))
turtle.down()
turtle.dot(9)# 眉毛(左)
points = [(-82, 89), (-78, 92), (-74, 95), (-67, 97), (-60, 97), 
(-54, 95), (-48, 93), (-45, 91), (-41, 89), (-38, 86), 
(-35, 83)]
plotLine(points, (0.67, 0.5, 0.22), width=2)# 眉毛(右)
points = [(22, 74), (26, 77), (31, 80), (40, 82), (48, 82), 
(55, 80), (63, 78), (70, 74), (75, 70), (79, 65)]
plotLine(points, (0.67, 0.5, 0.22), width=2)# 鼻子
points = [(-39, 2), (-46, 0), (-52, -2), (-55, -6), (-56, -10), 
(-56, -14), (-55, -17), (-52, -20), (-48, -23), (-44, -25), 
(-40, -26), (-35, -27), (-30, -28), (-24, -27), (-21, -26), 
(-17, -23), (-15, -21), (-14, -17), (-14, -12), (-15, -9), 
(-20, -4), (-22, -3), (-26, -1), (-30, 0), (-33, 1)]
plotPoly(points, True, pencolor=(0.2, 0.14, 0.11),fillcolor=(0.2, 0.14, 0.11), width=2)
turtle.pencolor((1, 1, 1))
turtle.up()
turtle.goto((-22, -12))
turtle.down()
turtle.dot(10)# 嘴巴
points = [(-71, -44), (-69, -48), (-63, -53), (-64, -56), (-66, -66), 
(-65, -78), (-65, -87), (-62, -92), (-59, -99), (-56, -103), 
(-50, -106), (-47, -109), (-39, -111), (-29, -111), (-23, -110), 
(-18, -108), (-13, -105), (-10, -102), (-6, -97), (-1, -90), 
(2, -83), (5, -75), (6, -69), (6, -60), (11, -65), 
(7, -61), (5, -58), (3, -53), (5, -58), (2, -58), 
(-5, -60), (-9, -60), (-14, -62), (-20, -62), (-25, -60), 
(-34, -60), (-43, -59), (-52, -57), (-58, -55), (-62, -54), 
(-67, -49)]
plotPoly(points, True, pencolor=(0.67, 0.5, 0.22),fillcolor=(0.89, 0.48, 0.43), width=2)
points = [(-62, -54), (-60, -55), (-57, -55), (-54, -57), (-49, -58), 
(-47, -60), (-50, -61), (-55, -63), (-59, -67), (-64, -72), 
(-65, -75), (-66, -69), (-65, -60)]
plotPoly(points, True, pencolor=(0.67, 0.5, 0.22),fillcolor=(0.63, 0.24, 0.25), width=0)# 隐藏海龟
turtle.hideturtle()turtle.done()

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/476403.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

SpringBoot学习记录(四)之分页查询

SpringBoot学习记录(四)之分页查询 一、业务需求1、基本信息2、请求参数3、相应数据 二、传统方式分页三、使用PageHelper分页插件 一、业务需求 根据条件进行员工数据的条件分页查询 1、基本信息 请求路径: /emps 请求方式: …

6. Spring Cloud Gateway网关超详细内容配置解析说明

6. Spring Cloud Gateway网关超详细内容配置解析说明 文章目录 6. Spring Cloud Gateway网关超详细内容配置解析说明前言1 Spring Cloud Gateway 概述1.1 Spring Cloud Gateway网关 的核心功能1.2 Spring Cloud Gateway VS Zuul 的区别1.3 Spring Cloud Gateway 的基本原理1.4 …

远程管理不再难!树莓派5安装Raspberry Pi OS并实现使用VNC异地连接

前言:大家好!今天我要教你们如何在树莓派5上安装Raspberry Pi OS,并配置SSH和VNC权限。通过这些步骤,你将能够在Windows电脑上使用VNC Viewer,结合Cpolar内网穿透工具,实现长期的公网远程访问管理本地树莓派…

Centos 8, add repo

Centos repo前言 Centos 8更换在线阿里云创建一键更换repo 自动化脚本 华为Centos 源 , 阿里云Centos 源 华为epel 源 , 阿里云epel 源vim /centos8_repo.sh #!/bin/bash # -*- coding: utf-8 -*- # Author: make.han

【机器学习】回归模型(线性回归+逻辑回归)原理详解

线性回归 Linear Regression 1 概述 线性回归类似高中的线性规划题目。线性回归要做的是就是找到一个数学公式能相对较完美地把所有自变量组合(加减乘除)起来,得到的结果和目标接近。 线性回归分为一元线性回归和多元线性回归。 2 一元线…

2024年亚太地区数学建模大赛D题-探索量子加速人工智能的前沿领域

量子计算在解决复杂问题和处理大规模数据集方面具有巨大的潜力,远远超过了经典计算机的能力。当与人工智能(AI)集成时,量子计算可以带来革命性的突破。它的并行处理能力能够在更短的时间内解决更复杂的问题,这对优化和…

STM32F103 GPIO和串口实战

本节我们将会对STM32F103的硬件资源GPIO和串口进行介绍。 一、GPIO 1.1 电路原理图 LED电路原理图如下图所示: 其中: LED1连接到PA8引脚,低电平点亮;LED2连接到PD2引脚,低电平点亮; 1.2 GPIO引脚介绍 STM32…

FileProvider高版本使用,跨进程传输文件

高版本的android对文件权限的管控抓的很严格,理论上两个应用之间的文件传递现在都应该是用FileProvider去实现,这篇博客来一起了解下它的实现原理。 首先我们要明确一点,FileProvider就是一个ContentProvider,所以需要在AndroidManifest.xml里面对它进行声明: <provideran…

国产linux系统(银河麒麟,统信uos)使用 PageOffice 动态生成word文件

PageOffice 国产版 &#xff1a;支持信创系统&#xff0c;支持银河麒麟V10和统信UOS&#xff0c;支持X86&#xff08;intel、兆芯、海光等&#xff09;、ARM&#xff08;飞腾、鲲鹏、麒麟等&#xff09;、龙芯&#xff08;LoogArch&#xff09;芯片架构。 数据区域填充文本 数…

《Python制作动态爱心粒子特效》

一、实现思路 粒子效果&#xff1a; – 使用Pygame模拟粒子运动&#xff0c;粒子会以爱心的轨迹分布并运动。爱心公式&#xff1a; 爱心的数学公式&#xff1a; x16sin 3 (t),y13cos(t)−5cos(2t)−2cos(3t)−cos(4t) 参数 t t 的范围决定爱心形状。 动态效果&#xff1a; 粒子…

[Docker-显示所有容器IP] 显示docker-compose.yml中所有容器IP的方法

本文由Markdown语法编辑器编辑完成。 1. 需求背景: 最近在启动一个服务时&#xff0c;突然发现它的一个接口&#xff0c;被另一个服务ip频繁的请求。 按理说&#xff0c;之前设置的是&#xff0c;每隔1分钟请求一次接口。但从日志来看&#xff0c;则是1秒钟请求一次&#xff…

JDK、MAVEN与IDEA的安装与配置

1.认识JDK、MAVEN与IDEA JDK 提供了编译和运行Java程序的基本环境。Maven 帮助管理项目的构建和依赖。IDEA 提供了一个强大的开发环境&#xff0c;使得编写、调试和运行Java程序更加高效。 2. 安装与环境配置 2.1 官网地址 选择你需要的版本下载&#xff1a; MAVEN下载传送…

C++标准模板库 -- map和set

序列式容器和关联式容器 在本篇文章之前&#xff0c;我们已经接触了STL中的部分容器&#xff1a;如string、vector、list、deque、array、forward_list等&#xff0c;这些容器被统称为序列式容器&#xff0c;因为逻辑结构为线性序列的数据结构&#xff0c;两个位置存储的值一般…

【Xbim+C#】创建圆盘扫掠IfcSweptDiskSolid

基础回顾 https://blog.csdn.net/liqian_ken/article/details/143867404 https://blog.csdn.net/liqian_ken/article/details/114851319 效果图 代码示例 在前文基础上&#xff0c;增加一个工具方法&#xff1a; public static IfcProductDefinitionShape CreateDiskSolidSha…

Flutter踩坑记录(三)-- 更改入口执行文件

我们在flutter 中可能不习惯默认的lib/main.dart 作为入口文件&#xff0c;会修改成index.dart 或者修改main.dart的位置, 用Andorid studio开发 如果我们用Andorid studio开发&#xff0c;默认修改一下配置地址 运行项目即可。 用VSCode开发 如果我们使用VSCode开发&…

AbsPlus框架介绍2

ABSPlus框架以其集成的多功能性在市场上脱颖而出。它不仅提供美观且符合主流风格的页面设计&#xff0c;还支持灵活的流程配置&#xff0c;包括算法处理流程和页面审批流程。在众多业务系统中&#xff0c;流程管理往往是核心且复杂的挑战&#xff0c;涉及数据库设计、页面开发以…

算法.图论-习题全集(Updating)

文章目录 本节设置的意义并查集篇并查集简介以及常见技巧并查集板子(洛谷)情侣牵手问题相似的字符串组岛屿数量(并查集做法)省份数量移除最多的同行或同列石头最大的人工岛找出知晓秘密的所有专家 建图及其拓扑排序篇链式前向星建图板子课程表 本节设置的意义 主要就是为了复习…

使用docker快速部署Nginx、Redis、MySQL、Tomcat以及制作镜像

文章目录 应用快速部署NginxRedisMySQLTomcat 制作镜像镜像原理基于已有容器创建使用 Dockerfile 创建镜像指令说明构建应用创建 Dockerfile 文件创建镜像 应用快速部署 Nginx docker run -d -p 80:80 nginx使用浏览器访问虚拟机地址 Redis docker pull redis docker run --…

图像处理 之 凸包和最小外围轮廓生成

“ 最小包围轮廓之美” 一起来欣赏图形之美~ 1.原始图片 男人牵着机器狗 2.轮廓提取 轮廓提取 3.最小包围轮廓 最小包围轮廓 4.凸包 凸包 5.凸包和最小包围轮廓的合照 凸包和最小包围轮廓的合照 上述图片中凸包、最小外围轮廓效果为作者实现算法生成。 图形几何之美系列&#…

Nuxt.js 应用中的 webpack:configResolved事件钩子

title: Nuxt.js 应用中的 webpack:configResolved事件钩子 date: 2024/11/21 updated: 2024/11/21 author: cmdragon excerpt: 在 Nuxt.js 项目中,webpack:configResolved 钩子允许开发者在 Webpack 配置被解析后读取和修改该配置。这一钩子在所有 Webpack 配置被合并和确…