用python画大白圣诞快乐呦

在这里插入图片描述
接触python做爬虫,最近有点儿无聊,看人家画的蛋糕有点难,那我就copy一个大白吧,大白比较简单
目前还不知道这个配图的位置应该怎么设计,学习ing

# coding=utf-8
# This is a sample Python script.

import turtle as t
import time

# 初始化画布
t.setup(width=800, height=600)

time.sleep(2)
t.hideturtle()
t.color("#FF6A6A")
t.penup()
t.goto(-300,220)
words1 = '当 '
words2 = ['送','给','小','可','爱']
for i in range(4):
    t.write(words1, font=("华文彩云", 3*i+14, "bold"))
    t.forward(20+3*i)
    time.sleep(0.15)
t.forward(8)
t.write("!", font=("华文彩云", 23, "bold"))
t.forward(20)
time.sleep(0.5)
for word in words2:
    t.write(word, font=("华文彩云", 26, "bold"))
    t.forward(35)
    time.sleep(0.4)
t.write(":", font=("华文彩云", 23, "bold"))
t.forward(35)
#大白
#
t.goto(-100,150)
t.right(90)
t.color("black")
t.pensize(1)
t.pendown()
size = 0.6
a = 0.8*size
for i in range(120):
    if 0 <= i < 30 or 60 <= i < 90:
        a = a + 0.2*size
        t.left(3)  # 向左转3
        t.forward(a)  # 向前走a的步长
    else:
        a = a - 0.2*size
        t.left(3)
        t.forward(a)
t.penup()
#眼睛
time.sleep(0.5)
t.goto(-70,150)
t.dot(14)
time.sleep(0.5)
t.goto(-24,150)
t.dot(14)
time.sleep(0.5)
t.right(60)
t.pendown()
t.speed(2)
t.circle(-50,50)
#身体
t.penup()
t.goto(-89.85,131.47)
t.left(65)
t.pendown()
t.circle(250,60)
t.penup()
t.goto(-2.64,133.09)
t.left(30)
t.pendown()
t.circle(-250,60)
t.right(20)
t.circle(-134,110)
#
t.penup()
t.left(135)
t.goto(-120,-145)
t.pendown()
t.circle(120,45)
t.left(15)
t.circle(42,80)
t.left(50)
t.forward(70)
t.penup()
t.back(70)
t.pendown()
t.right(130)
t.circle(42,80)
t.left(15)
t.circle(115,48)
t.penup()
#胳膊
t.goto(-125,89)
t.pendown()
t.left(112)
t.circle(250,50)
t.circle(50,45)
t.circle(20,80)
t.circle(50,45)
t.circle(180,16)
t.penup()
t.goto(31,90)
t.pendown()
t.right(126)
t.circle(-250,50)
t.circle(-50,45)
t.circle(-20,80)
t.circle(-50,45)
t.circle(-180,14)
#
t.penup()
t.goto(-208,-90)
t.pendown()
t.left(150)
t.right(180)
t.circle(-30,20)
t.penup()
t.goto(-208,-90)
t.right(160)
t.pendown()
t.circle(30,40)
t.circle(5,120)
t.circle(40,40)


#画玫瑰
t.penup()
t.goto(-270,60)
t.pendown()
#玫瑰花角度
t.right(60)
#玫瑰花大小
size=0.35
# 花蕊
t.fillcolor("#EE0000")
t.begin_fill()
t.circle(10*size, 180)
t.circle(25*size, 110)
t.left(50)
t.circle(60*size, 45)
t.circle(20*size, 170)
t.right(24)
t.forward(30*size)
t.left(10)
t.circle(30*size, 110)
t.forward(20*size)
t.left(40)
t.circle(90*size, 70)
t.circle(30*size, 150)
t.right(30)
t.forward(15*size)
t.circle(80*size, 90)
t.left(15)
t.forward(45*size)
t.right(165)
t.forward(20*size)
t.left(155)
t.circle(150*size, 80)
t.left(50)
t.circle(150*size, 90)
t.end_fill()
# 花瓣1
t.left(150)
t.circle(-90*size, 70)
t.left(20)
t.circle(75*size, 105)
t.setheading(80)
t.circle(80*size, 98)
t.circle(-90*size, 40)
# 花瓣2
t.left(180)
t.circle(90*size, 40)
t.circle(-80*size, 98)
t.setheading(-63.5)
# 叶子1
t.forward(30*size)
t.left(90)
t.forward(25*size)
t.left(45)
t.fillcolor("#00CD00")
t.begin_fill()
t.circle(-80*size, 90)
t.right(90)
t.circle(-80*size, 90)
t.end_fill()
t.right(135)
t.forward(60*size)
t.left(180)
t.penup()
t.forward(85*size)
t.pendown()
t.left(90)
t.forward(80*size)
# 叶子2
t.right(90)
t.right(45)
t.fillcolor("#00CD00")
t.begin_fill()
t.circle(80*size, 90)
t.left(90)
t.circle(80*size, 90)
t.end_fill()
t.left(135)
t.forward(60*size)
t.left(180)
t.forward(60*size)
t.right(90)
t.circle(-1000*size,8.6)
t.penup()
t.goto(-200,-110)
t.pendown()
t.circle(-1000*size,10)

#圣诞快乐
words3 = ['圣 ','诞 ','快 ','乐 ','呦 ','!']
t.penup()
t.color("#FF6A6A")
t.goto(30,220)
t.setheading(0)
for word in words3:
    t.write(word, font=("华文彩云", 26, "bold"))
    t.forward(35)
    time.sleep(0.4)
t.done()


  • 1
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值