• python 表白代码 biu 比心


    使用标准库 turtle 制作表白代码

    快去发给心爱的人吧!你不发,别人就发了。

    效果截图:

    在这里插入图片描述

    要不然看一下 动态图 :

    请添加图片描述

    代码:

    import time
    import turtle as t
    t.speed(0)
    t.pensize(4)
    
    t.home()
    t.left(30)
    t.circle(100, 300)
    p = t.position()
    
    t.up()
    t.goto(-28, 125)
    t.down()
    t.begin_fill()
    t.fillcolor("black")
    t.circle(10)
    t.end_fill()
    
    t.begin_fill()
    t.fillcolor("white")
    t.circle(6)
    t.end_fill()
    
    t.up()
    t.goto(-100, 115)
    t.down()
    t.begin_fill()
    t.fillcolor("black")
    t.circle(10)
    t.end_fill()
    
    t.up()
    t.goto(-95, 120)
    t.down()
    t.begin_fill()
    t.fillcolor("white")
    t.circle(6)
    t.end_fill()
    
    t.up()
    t.goto(-120, 60)
    t.pencolor("pink")
    t.down()
    t.seth(90)
    t.forward(8)
    t.up()
    t.goto(-110, 60)
    t.pencolor("pink")
    t.down()
    t.seth(90)
    t.forward(12)
    
    t.up()
    t.goto(10, 80)
    t.pencolor("pink")
    t.down()
    t.seth(90)
    t.forward(8)
    t.up()
    t.goto(0, 80)
    t.pencolor("pink")
    t.down()
    t.seth(90)
    t.forward(12)
    
    t.up()
    t.goto(-40, 70)
    t.down()
    t.pencolor("black")
    t.left(180)
    t.circle(-16,170)
    
    t.up()
    t.goto(p[0], p[1])
    t.down()
    t.left(150)
    t.circle(100, 30)
    t.left(80)
    t.forward(10)
    
    p2 = t.position()
    t.up()
    t.goto(p2[0]+10, p2[1]+20)
    t.down()
    t.seth(0)
    t.right(95)
    t.forward(100)
    t.right(90)
    t.forward(10)
    t.circle(10,90)
    t.left(95)
    t.forward(60)
    t.left(90)
    t.forward(20)
    t.circle(-10,180)
    t.forward(20)
    t.left(90)
    t.forward(50)
    t.circle(10, 90)
    t.left(90)
    t.forward(10)
    t.right(85)
    t.forward(70)
    t.circle(90, 25)
    p = t.position()
    
    t.up()
    t.goto(p[0]+10, p[1])
    t.down()
    t.seth(30)
    t.forward(80)
    t.right(50)
    t.circle(80, 15)
    t.left(100)
    t.forward(10)
    t.right(50)
    t.forward(20)
    t.circle(4, 180)
    t.right(5)
    t.forward(20)
    t.right(80)
    t.forward(10)
    t.right(50)
    t.circle(4, 180)
    t.left(30)
    t.forward(10)
    t.right(100)
    t.forward(80)
    
    t.up()
    t.goto(88, 45)
    t.down()
    t.pencolor("pink")
    t.setheading(0)
    t.begin_fill()
    t.color("pink")
    t.left(45)
    t.forward(20)
    t.circle(10, 180)
    t.right(90)
    t.circle(10, 180)
    t.forward(20)
    t.end_fill()
    
    t.pencolor("white")
    t.up()
    t.goto(77, 55)
    t.down()
    t.write("比心",font=("Arial",10,"bold"))
    
    t.pencolor("black")
    t.up()
    t.goto(88, -20)
    t.down()
    t.write("b",font=("Arial",16,"bold"))
    t.up()
    t.goto(102, -18)
    t.down()
    t.write("i",font=("Arial",16,"bold"))
    t.up()
    t.goto(110, -16)
    t.down()
    t.write("u",font=("Arial",16,"bold"))
    
    t.up()
    t.goto(240, 50)
    t.down()
    t.pencolor("red")
    t.setheading(0)
    t.begin_fill()
    t.color("red")
    t.left(45)
    t.forward(100)
    t.circle(50, 180)
    t.right(90)
    t.circle(50, 180)
    t.forward(100)
    t.end_fill()
    
    t.pencolor("red")
    text = "爱你哦~~~"
    j = 1
    t.up()
    t.goto(-104, 215)
    t.down()
    a = t.position()
    for txt in text:
        t.write(txt, font=("Arial", 15, "bold"))
        t.up()
        t.goto(a[0]+(j*30), a[1])
        t.down()
        j += 1
        time.sleep(0.05)
    
    t.up()
    t.goto(-80, -240)
    t.down()
    text = "要源码评论区讲哈~~~"
    t.write(text, font=("Arial", 15, "bold"))
    
    t.ht()
    t.done()
    
    
    • 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
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203

    ---- 结束 ----
    仅学习。

  • 相关阅读:
    JSP response,request操作中(中文乱码)-如何解决呢?
    linux内核源码分析之物理内存
    跑通Intellij Platform Plugin项目
    jdk、jre、jvm区别
    编程题01——十进制转二进制
    CVE-2021-44548 Apache Solr 敏感信息泄露漏洞分析及复现
    Kubernetes基础概念及架构和组件
    VS Code 中使用Git实践,学会了效率翻倍!
    宅家30天,2万字节java高级工程师面试题解析,如何斩获阿里p7
    Android全屏显示和屏幕旋转的处理
  • 原文地址:https://blog.csdn.net/qq_52722885/article/details/127905519