2022-05-05
17:36:44
1 import turtle
2
3 turtle.title('Python(冰墩墩)')
4 turtle.speed(10) # 可以自己调节速度
5
6 # 左手
7 turtle.penup()
8
9 turtle.goto(177, 112)
10
11 turtle.pencolor("lightgray")
12
13 turtle.pensize(3)
14
15 turtle.fillcolor("white")
16
17 turtle.begin_fill()
18
19 turtle.pendown()
20
21 turtle.setheading(80)
22
23 turtle.circle(-45, 200)
24
25 turtle.circle(-300, 23)
26
27 turtle.end_fill()
28
29 # 左手内
30 turtle.penup()
31
32 turtle.goto(182, 95)
33
34 turtle.pencolor("black")
35
36 turtle.pensize(1)
37
38 turtle.fillcolor("black")
39
40 turtle.begin_fill()
41
42 turtle.setheading(95)
43
44 turtle.pendown()
45
46 turtle.circle(-37, 160)
47
48 turtle.circle(-20, 50)
49
50 turtle.circle(-200, 30)
51
52 turtle.end_fill()
53
54 # 轮廓
55 # 头顶
56 turtle.penup()
57
58 turtle.goto(-73, 230)
59
60 turtle.pencolor("lightgray")
61
62 turtle.pensize(3)
63
64 turtle.fillcolor("white")
65
66 turtle.begin_fill()
67
68 turtle.pendown()
69
70 turtle.setheading(20)
71
72 turtle.circle(-250, 35)
73
74 # 左耳
75 turtle.setheading(50)
76
77 turtle.circle(-42, 180)
78
79 # 左侧
80 turtle.setheading(-50)
81
82 turtle.circle(-190, 30)
83
84 turtle.circle(-320, 45)
85
86 # 左腿
87 turtle.circle(120, 30)
88
89 turtle.circle(200, 12)
90
91 turtle.circle(-18, 85)
92
93 turtle.circle(-180, 23)
94
95 turtle.circle(-20, 110)
96
97 turtle.circle(15, 115)
98
99 turtle.circle(100, 12)
100
101 # 右腿
102 turtle.circle(15, 120)
103
104 turtle.circle(-15, 110)
105
106 turtle.circle(-150, 30)
107
108 turtle.circle(-15, 70)
109
110 turtle.circle(-150, 10)
111
112 turtle.circle(200, 35)
113
114 turtle.circle(-150, 20)
115
116 # 右手
117 turtle.setheading(-120)
118
119 turtle.circle(50, 30)
120
121 turtle.circle(-35, 200)
122
123 turtle.circle(-300, 23)
124
125 # 右侧
126 turtle.setheading(86)
127
128 turtle.circle(-300, 26)
129
130 # 右耳
131 turtle.setheading(122)
132
133 turtle.circle(-53, 160)
134
135 turtle.end_fill()
136
137
138
139 # 右耳内
140 turtle.penup()
141
142 turtle.goto(-130, 180)
143
144 turtle.pencolor("black")
145
146 turtle.pensize(1)
147
148 turtle.fillcolor("black")
149
150 turtle.begin_fill()
151
152 turtle.pendown()
153
154 turtle.setheading(120)
155
156 turtle.circle(-28, 160)
157
158 turtle.setheading(210)
159
160 turtle.circle(150, 20)
161
162 turtle.end_fill()
163
164
165
166 # 左耳内
167 turtle.penup()
168
169 turtle.goto(90, 230)
170
171 turtle.setheading(40)
172
173 turtle.begin_fill()
174
175 turtle.pendown()
176
177 turtle.circle(-30, 170)
178
179 turtle.setheading(125)
180
181 turtle.circle(150, 23)
182
183 turtle.end_fill()
184
185
186
187 # 右手内
188 turtle.penup()
189
190 turtle.goto(-180, -55)
191
192 turtle.fillcolor("black")
193
194 turtle.begin_fill()
195
196 turtle.setheading(-120)
197
198 turtle.pendown()
199
200 turtle.circle(50, 30)
201
202 turtle.circle(-27, 200)
203
204 turtle.circle(-300, 20)
205
206 turtle.setheading(-90)
207
208 turtle.circle(300, 14)
209
210 turtle.end_fill()
211
212
213
214 # 左腿内
215 turtle.penup()
216
217 turtle.goto(108, -168)
218
219 turtle.fillcolor("black")
220
221 turtle.begin_fill()
222
223 turtle.pendown()
224
225 turtle.setheading(-115)
226
227 turtle.circle(110, 15)
228
229 turtle.circle(200, 10)
230
231 turtle.circle(-18, 80)
232
233 turtle.circle(-180, 13)
234
235 turtle.circle(-20, 90)
236
237 turtle.circle(15, 60)
238
239 turtle.setheading(42)
240
241 turtle.circle(-200, 29)
242
243 turtle.end_fill()
244
245 # 右腿内
246 turtle.penup()
247
248 turtle.goto(-38, -210)
249
250 turtle.fillcolor("black")
251
252 turtle.begin_fill()
253
254 turtle.pendown()
255
256 turtle.setheading(-155)
257
258 turtle.circle(15, 100)
259
260 turtle.circle(-10, 110)
261
262 turtle.circle(-100, 30)
263
264 turtle.circle(-15, 65)
265
266 turtle.circle(-100, 10)
267
268 turtle.circle(200, 15)
269
270 turtle.setheading(-14)
271
272 turtle.circle(-200, 27)
273
274 turtle.end_fill()
275
276
277
278 # 右眼
279 # 眼圈
280 turtle.penup()
281
282 turtle.goto(-64, 120)
283
284 turtle.begin_fill()
285
286 turtle.pendown()
287
288 turtle.setheading(40)
289
290 turtle.circle(-35, 152)
291
292 turtle.circle(-100, 50)
293
294 turtle.circle(-35, 130)
295
296 turtle.circle(-100, 50)
297
298 turtle.end_fill()
299
300 # 眼珠
301 turtle.penup()
302
303 turtle.goto(-47, 55)
304
305 turtle.fillcolor("white")
306
307 turtle.begin_fill()
308
309 turtle.pendown()
310
311 turtle.setheading(0)
312
313 turtle.circle(25, 360)
314
315 turtle.end_fill()
316
317 turtle.penup()
318
319 turtle.goto(-45, 62)
320
321 turtle.pencolor("darkslategray")
322
323 turtle.fillcolor("darkslategray")
324
325 turtle.begin_fill()
326
327 turtle.pendown()
328
329 turtle.setheading(0)
330
331 turtle.circle(19, 360)
332
333 turtle.end_fill()
334
335 turtle.penup()
336
337 turtle.goto(-45, 68)
338
339 turtle.fillcolor("black")
340
341 turtle.begin_fill()
342
343 turtle.pendown()
344
345 turtle.setheading(0)
346
347 turtle.circle(10, 360)
348
349 turtle.end_fill()
350
351 turtle.penup()
352
353 turtle.goto(-47, 86)
354
355 turtle.pencolor("white")
356
357 turtle.fillcolor("white")
358
359 turtle.begin_fill()
360
361 turtle.pendown()
362
363 turtle.setheading(0)
364
365 turtle.circle(5, 360)
366
367 turtle.end_fill()
368
369
370
371 # 左眼
372 # 眼圈
373 turtle.penup()
374
375 turtle.goto(51, 82)
376
377 turtle.fillcolor("black")
378
379 turtle.begin_fill()
380
381 turtle.pendown()
382
383 turtle.setheading(120)
384
385 turtle.circle(-32, 152)
386
387 turtle.circle(-100, 55)
388
389 turtle.circle(-25, 120)
390
391 turtle.circle(-120, 45)
392
393 turtle.end_fill()
394
395 # 眼珠
396 turtle.penup()
397
398 turtle.goto(79, 60)
399
400 turtle.fillcolor("white")
401
402 turtle.begin_fill()
403
404 turtle.pendown()
405
406 turtle.setheading(0)
407
408 turtle.circle(24, 360)
409
410 turtle.end_fill()
411
412 turtle.penup()
413
414 turtle.goto(79, 64)
415
416 turtle.pencolor("darkslategray")
417
418 turtle.fillcolor("darkslategray")
419
420 turtle.begin_fill()
421
422 turtle.pendown()
423
424 turtle.setheading(0)
425
426 turtle.circle(19, 360)
427
428 turtle.end_fill()
429
430 turtle.penup()
431
432 turtle.goto(79, 70)
433
434 turtle.fillcolor("black")
435
436 turtle.begin_fill()
437
438 turtle.pendown()
439
440 turtle.setheading(0)
441
442 turtle.circle(10, 360)
443
444 turtle.end_fill()
445
446 turtle.penup()
447
448 turtle.goto(79, 88)
449
450 turtle.pencolor("white")
451
452 turtle.fillcolor("white")
453
454 turtle.begin_fill()
455
456 turtle.pendown()
457
458 turtle.setheading(0)
459
460 turtle.circle(5, 360)
461
462 turtle.end_fill()
463
464
465
466 # 鼻子
467 turtle.penup()
468
469 turtle.goto(37, 80)
470
471 turtle.fillcolor("black")
472
473 turtle.begin_fill()
474
475 turtle.pendown()
476
477 turtle.circle(-8, 130)
478
479 turtle.circle(-22, 100)
480
481 turtle.circle(-8, 130)
482
483 turtle.end_fill()
484
485
486
487 # 嘴
488 turtle.penup()
489
490 turtle.goto(-15, 48)
491
492 turtle.setheading(-36)
493
494 turtle.begin_fill()
495
496 turtle.pendown()
497
498 turtle.circle(60, 70)
499
500 turtle.setheading(-132)
501
502 turtle.circle(-45, 100)
503
504 turtle.end_fill()
505
506
507
508 # 彩虹圈
509 turtle.penup()
510
511 turtle.goto(-135, 120)
512
513 turtle.pensize(5)
514
515 turtle.pencolor("cyan")
516
517 turtle.pendown()
518
519 turtle.setheading(60)
520
521 turtle.circle(-165, 150)
522
523 turtle.circle(-130, 78)
524
525 turtle.circle(-250, 30)
526
527 turtle.circle(-138, 105)
528
529 turtle.penup()
530
531 turtle.goto(-131, 116)
532
533 turtle.pencolor("slateblue")
534
535 turtle.pendown()
536
537 turtle.setheading(60)
538
539 turtle.circle(-160, 144)
540
541 turtle.circle(-120, 78)
542
543 turtle.circle(-242, 30)
544
545 turtle.circle(-135, 105)
546
547 turtle.penup()
548
549 turtle.goto(-127, 112)
550
551 turtle.pencolor("orangered")
552
553 turtle.pendown()
554
555 turtle.setheading(60)
556
557 turtle.circle(-155, 136)
558
559 turtle.circle(-116, 86)
560
561 turtle.circle(-220, 30)
562
563 turtle.circle(-134, 103)
564
565 turtle.penup()
566
567 turtle.goto(-123, 108)
568
569 turtle.pencolor("gold")
570
571 turtle.pendown()
572
573 turtle.setheading(60)
574
575 turtle.circle(-150, 136)
576
577 turtle.circle(-104, 86)
578
579 turtle.circle(-220, 30)
580
581 turtle.circle(-126, 102)
582
583 turtle.penup()
584
585 turtle.goto(-120, 104)
586
587 turtle.pencolor("greenyellow")
588
589 turtle.pendown()
590
591 turtle.setheading(60)
592
593 turtle.circle(-145, 136)
594
595 turtle.circle(-90, 83)
596
597 turtle.circle(-220, 30)
598
599 turtle.circle(-120, 100)
600
601 turtle.penup()
602
603
604
605 # 爱心
606 turtle.penup()
607
608 turtle.goto(220, 115)
609
610 turtle.pencolor("brown")
611
612 turtle.pensize(1)
613
614 turtle.fillcolor("brown")
615
616 turtle.begin_fill()
617
618 turtle.pendown()
619
620 turtle.setheading(36)
621
622 turtle.circle(-8, 180)
623
624 turtle.circle(-60, 24)
625
626 turtle.setheading(110)
627
628 turtle.circle(-60, 24)
629
630 turtle.circle(-8, 180)
631
632 turtle.end_fill()
633
634
635
636 # 五环
637 turtle.penup()
638
639 turtle.goto(-5, -170)
640
641 turtle.pendown()
642
643 turtle.pencolor("blue")
644
645 turtle.circle(6)
646
647 turtle.penup()
648
649 turtle.goto(10, -170)
650
651 turtle.pendown()
652
653 turtle.pencolor("black")
654
655 turtle.circle(6)
656
657 turtle.penup()
658
659 turtle.goto(25, -170)
660
661 turtle.pendown()
662
663 turtle.pencolor("brown")
664
665 turtle.circle(6)
666
667 turtle.penup()
668
669 turtle.goto(2, -175)
670
671 turtle.pendown()
672
673 turtle.pencolor("lightgoldenrod")
674
675 turtle.circle(6)
676
677 turtle.penup()
678
679 turtle.goto(16, -175)
680
681 turtle.pendown()
682
683 turtle.pencolor("green")
684
685 turtle.circle(6)
686
687 turtle.penup()
688
689
690
691 turtle.pencolor("black")
692
693 turtle.goto(-16, -160)
694 turtle.write("BEIJING 2022", font=('Arial', 10, 'bold italic'))
695
696 turtle.hideturtle()
697
698
699
700 turtle.done()