用python画一只布朗熊
2023-02-19 12:20:00 时间
无意间在抖音发了一个用python画布朗熊的视频,没想到想要代码的人还挺多,现在就把代码发布在这里,需要的朋友自取。
特别注意:python版本过高可能报turtle版本低的错误。
from turtle import *
ht()
setup(400,800,0,0)
seth(0)
pensize(3)
pencolor("black")
pu() #penup()
goto(0,100)
pd() #pendown()
fillcolor("brown")
begin_fill()
circle(100)
end_fill()
pu()
goto(0,150)
pd()
fillcolor("white")
begin_fill()
pencolor("white")
circle(30)
end_fill()
pencolor("black")
pu()
goto(0,179)
lt(45)
fd(35)
rt(45)
pd()
fillcolor("black")
begin_fill()
circle(10)
end_fill()
pu()
goto(0,179)
lt(135)
fd(35)
rt(135)
pd()
fillcolor("black")
begin_fill()
circle(10)
end_fill()
pu()
goto(0,180)
pd()
fillcolor("black")
begin_fill()
circle(6)
end_fill()
goto(-3,180)
seth(-135)
pensize(5)
fd(12)
pu()
goto(3,180)
pd()
seth(-45)
pensize(5)
fd(12)
pensize(3)
pu()
goto(0,200)
seth(30)
fd(100)
pd()
fillcolor("brown")
begin_fill()
circle(30,215)
end_fill()
pu()
goto(0,200)
seth(150)
fd(100)
pd()
fillcolor("brown")
begin_fill()
circle(-30,215)
end_fill()
pu()
goto(50*pow(3,0.5),152) #pow(x,y)=x**y
seth(60)
pd()
fillcolor("brown")
begin_fill()
circle(-15,180)
circle(-130,30)
seth(-90)
circle(-1000,8)
for i in range(2):
seth(-90)
circle(-27,180)
lt(10)
circle(-1000,8)
seth(150)
circle(-130,30)
circle(-16,180)
circle(100,120)
end_fill()
pu()
goto(0,80)
seth(0)
pd()
pencolor("black")
fillcolor("black")
begin_fill()
circle(-40)
end_fill()
done()
相关文章
- 基于Python的人脸识别考勤监控
- Python答题游戏
- Python调用百度API实现图像识别
- Python全栈疫情分析项目
- Python-基础-if语句快速入门
- Python-基础-循环语句快速入门
- Python-GUI签名
- 【2】VScode 搭建python和tensorflow环境
- python 简易时钟
- 【1】windows系统如何安装后缀是whl的python库
- 【2】超级详细Python-matplotlib画图,手把手教你画图!(线条颜色、大小、线形、标签)
- 【4】python读写文件操作---详细讲解!
- 【2】Anaconda下:ipython文件的打开方式,Jupyter Notebook中运行.py文件,快速打开ipython文件的方法!
- 【编写环境一】遇到常见python函数处理方式
- 【编写环境二】python库scipy.stats各种分布函数生成、以及随机数生成【泊松分布、正态分布等】
- Python xlwt数据保存到 Excel中以及xlrd读取excel文件画图
- 强化学习技巧三:Python多进程
- 强化学习技巧五:numba提速python程序
- 【7】python_matplotlib 输出(保存)矢量图方法;画图时图例说明(legend)放到图像外侧;Python_matplotlib图例放在外侧保存时显示不完整问题解决
- 【8】python_matplotlib改变横坐标和纵坐标上的刻度(ticks)、sagemath-list_plot()调整图例(legend)中点的数量、Matplotlib画各种论文图