turtle库的学习

      Turtle库是Python语言中一个很流行的绘制图像的函数库,想象一个小乌龟,在一个横轴为x、纵轴为y的坐标系原点,(0,0)位置开始,它根据一组函数指令的控制,在这个平面坐标系中移动,从而在它爬行的路径上绘制了图形。

1 安装turtle

Python2安装命令:

pip install turtule

Python3安装命令:

pip3 install turtle

因为turtle库主要是在Python2中使用的,所以安装的时候可能会提示错误:

Command "python setup.py egg_info" failed with error code 1

解决方法请参考这里码客社区的《Python3安装turtle提示错误:https://oomake.com/question/178949》。

猜你喜欢

转载自www.cnblogs.com/lzxbs/p/10526710.html