【整活】使用海龟画图画一个绿码

【整活】使用海龟画图画一个·绿码·


前言

例如:全球疫情事态严重,希望疫情早日退散,今天用python中的画图库画一个绿码。


展示

视频展示:https://www.bilibili.com/video/BV1aY4y1Y73e?spm_id_from=333.999.0.0(b站)
图片展示:
在这里插入图片描述

一、使用了什么工具

1.python
2.turtle

二、使用步骤

1.引入库

代码如下(示例):

import turtle as h

2.完整代码

代码如下(示例):

import turtle as h
from unicodedata import name
h.setup(width=400,height=675)
h.title("行程码")
h.screensize(300,500,"#2ba568")
h.speed(1)
# 框
h.begin_fill()
h.color("#ffffff","#ffffff")
h.penup()
h.goto(-150,-150)
h.pendown()
h.goto(-150,200)
h.goto(150,200)
h.goto(150,-150)
h.goto(-150,-150)
h.end_fill()
# 绿色圆圈
h.penup()
h.goto(0,-60)
h.begin_fill()
h.color("#2ba568","#2ba568")

h.circle(70)
h.end_fill()
h.penup()
h.goto(0,-50)
h.pendown()
h.begin_fill()
h.color("#ffffff","#ffffff")
h.circle(60)
h.end_fill()
# 绿色圆圈
# 箭头下部分

h.penup()
h.color("#2ba568","#2ba568")
h.begin_fill()
h.goto(5,-40)
h.pendown()
h.goto(5,40)
h.goto(-5,40)
h.goto(-5,-40)
h.goto(5,-40)
h.end_fill()
# 箭头上部分
h.penup()
h.color("#2ba568","#2ba568")
h.begin_fill()
h.goto(5,40)
h.pendown()
h.goto(35,10)
h.goto(35,20)
h.goto(0,60)
h.goto(-35,20)
h.goto(-35,10)
h.goto(-5,40)
h.goto(5,40)
h.end_fill()
# 文字部分
h.penup()
h.goto(-130,250)
h.color("#ffffff","#ffffff")
h.write("通信大数据行程卡",font=("黑体",25,"bold"))
h.penup()
h.goto(-80,215)
h.color("#ffffff","#ffffff")
h.write("疫情防控,人人有责",font=("黑体",13))
h.penup()
h.goto(-90,160)
h.color("#000000","#ffffff")
h.write("全中国人民的动态行程卡",font=("黑体",13))
h.penup()
h.goto(-50,120)
h.color("#8e8e8e","#8e8e8e")
h.write("更新于:每一天",font=("黑体",12))
h.penup()
h.goto(-140,-100)
h.pendown()
h.color("#8e8e8e","#8e8e8e")
h.goto(140,-100)
h.penup()
h.goto(-140,-130)
h.color("#8e8e8e","#8e8e8e")
h.write("您于前14天内到达或途径:",font=("黑体",10))
h.penup()
h.goto(-140,-180)
h.color("#ffffff","#ffffff")
h.write("结果包涵您在前14天内到访的国家(地区)与停留4小时以上的",font=("Arial",8))
h.penup()
h.goto(-80,-200)
h.color("#ffffff","#ffffff")
h.write("国内城市色卡,仅对造访地做提醒",font=("Arial",8))
h.penup()
h.goto(-140,-240)
h.pendown()
h.goto(-60,-240)
h.penup()
h.goto(-40,-250)
h.write("本服务联合提供",font=("Arial",10))
h.penup()
h.goto(70,-240)
h.pendown()
h.goto(140,-240)
h.penup()
h.goto(-60,-290)

h.color("#ffffff","#ffffff")
h.write("客服热线:8208 / 2088 /2 0",font=("Arial",8))
h.done()

总结

使用了python中的turtle绘制图形
希望疫情结束!!!!!!!!!!!!!

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值