python简笔画

中秋节试着用python画了一次简笔画

在这里插入图片描述
源码 :

import turtle as t
t.screensize(800,600,"#1A0E3C")#画布尺寸和颜色

#渐变
#1
t.up()
t.goto(-400,100)
t.pd()

t.fillcolor('#1F0047')
t.begin_fill()
t.pencolor('#1F0047')
t.pensize(180)
t.forward(800)
t.end_fill()
t.hideturtle()

t.up()
t.goto(-400,-40)
t.pd()

t.pencolor('#2C0D59')
t.pensize(120)
t.forward(800)
t.end_fill()
t.hideturtle()

t.up()
t.goto(-400,-140)
t.pd()

t.pencolor('#422367')
t.pensize(120)
t.forward(800)
t.end_fill()
t.hideturtle()

t.up()
t.goto(-400,-220)
t.pd()

t.pencolor('#543973')
t.pensize(100)
t.forward(800)
t.end_fill()
t.hideturtle()


t.up()
t.goto(-400,-300)
t.pd()

t.pencolor('#9382A7')
t.pensize(80)
t.forward(800)
t.end_fill()
t.hideturtle()

#星星
t.up()
t.goto(-200,-200)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(2)
t.circle(2)
t.end_fill()

t.up()
t.goto(-240,235)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(2)
t.circle(2)
t.end_fill()

t.up()
t.goto(-240,150)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(2)
t.circle(2)
t.end_fill()

t.up()
t.goto(-240,-100)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(2)
t.circle(2)
t.end_fill()

t.up()
t.goto(0,-210)
t.pd()

t.fillcolor('#FFFFE0')
t.begin_fill()
t.pencolor('#FFFFE0')
t.pensize(2)
t.circle(2)
t.end_fill()

t.up()
t.goto(200,200)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(2)
t.circle(2)
t.end_fill()

t.up()
t.goto(-200,200)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(2)
t.circle(2)
t.end_fill()

t.up()
t.goto(200,-200)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(2)
t.circle(2)
t.end_fill()

t.up()
t.goto(100,100)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(2)
t.circle(2)
t.end_fill()

t.up()
t.goto(25,79)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(2)
t.circle(2)
t.end_fill()

t.up()
t.goto(64,235)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(2)
t.circle(2)
t.end_fill()

t.up()
t.goto(86,-134)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(2)
t.circle(2)
t.end_fill()

t.up()
t.goto(-95,98)
t.pd()

t.fillcolor('#DCDCDC')
t.begin_fill()
t.pencolor('#DCDCDC')
t.pensize(2)
t.circle(2)
t.end_fill()

t.up()
t.goto(-210,39)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(2)
t.circle(2)
t.end_fill()

#月亮
t.up()#抬起笔
t.goto(-120,80)#把笔移到坐标的位置
t.pd()#放下笔

t.fillcolor('#ECDC9C')#填充色
t.begin_fill()#开始填充(一定要在画你想画的图案之前)
t.pencolor('#ECDC9C')#画笔颜色
t.pensize(3)#画笔尺寸
t.circle(100)#圆的半径
t.end_fill()#结束填充(在画完之后)

#环形山

t.up()
t.goto(-120,90)
t.pd()

t.fillcolor('#DDB865')
t.begin_fill()
t.pencolor('#DDB865')
t.pensize(3)
t.circle(5)
t.end_fill()

t.up()
t.goto(-80,124)
t.pd()

t.pencolor('#DDB865')
t.pensize(3)
t.circle(15)
t.end_fill()

t.up()
t.goto(-62,110)
t.pd()

t.fillcolor('#DDB865')
t.begin_fill()
t.pencolor('#DDB865')
t.pensize(3)
t.circle(18)
t.end_fill()

t.up()
t.goto(-75,178)
t.pd()

t.fillcolor('#DDB865')
t.begin_fill()
t.pencolor('#DDB865')
t.pensize(3)
t.circle(32)
t.end_fill()

 
#云
t.up()
t.goto(-60,-43)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(3)
t.circle(30)
t.end_fill()

t.up()
t.goto(-70,-100)
t.pd

t.fillcolor('#DCD2E6')
t.begin_fill()
t.pencolor('#DCD2E6')
t.pensize(3)
t.circle(30)
t.end_fill()

t.up()
t.goto(-100,-40)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(3)
t.circle(25)
t.end_fill()

t.up()
t.goto(-114,-100)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(3)
t.circle(45)
t.end_fill()


t.up()
t.goto(-24,-100)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(3)
t.circle(45)
t.end_fill()

#云2
t.up()
t.goto(140,40)
t.pd()

t.fillcolor('#DCD2E6')
t.begin_fill()
t.pencolor('#DCD2E6')
t.pensize(3)
t.circle(40)
t.end_fill()

t.up()
t.goto(130,0)
t.pd()

t.fillcolor('#DCD2E6')
t.begin_fill()
t.pencolor('#DCD2E6')
t.pensize(3)
t.circle(40)
t.end_fill()

t.up()
t.goto(110,64)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(3)
t.circle(35)
t.end_fill()

t.up()
t.goto(80,10)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(3)
t.circle(45)
t.end_fill()


t.up()
t.goto(170,0)
t.pd()

t.fillcolor('#ffffff')
t.begin_fill()
t.pencolor('#ffffff')
t.pensize(3)
t.circle(45)
t.end_fill()

参考文章 :
如何用python代码画一个月亮

  • 1
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Romronronronronron

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值