好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

如何用python画笑脸

如何用python画笑脸?首先我们要先下载安装好python程序,然后再下载安装turtle包。把一切准备工作做完才能开始我们接下来的绘画工作。

1.在我们自己的电脑上找到python 的IDLE工具。

2.然后打开IDLE,新建一个文件,命名为test1.py。

相关推荐:《python视频教程》

3.接着我们就开始导入turtle库,然后编辑代码。

from turtle import *
penup()
goto(0,-200)
pendown()
circle(200)
penup()
goto(-100,50)
pendown()
begin_fill()
circle(17.5)
end_fill()
penup()
goto(100,50)
pendown()
begin_fill()
circle(17.5)
end_fill()
penup()
goto(0,50)
pendown()
circle(-70,steps=3)
penup()
goto(-150,-70)
pendown()
right(15)
goto(0,-170)
goto(150,-70)
hideturtle() 

4.F5运行代码,查看效果图。

以上就是如何用python画笑脸的详细内容,更多请关注Gxl网其它相关文章!

查看更多关于如何用python画笑脸的详细内容...

  阅读:44次