turtle 库的学习笔记

Note of Python Turtle

        Turtle 库函数是 Python语言中一个流行的绘图函数库。Turtle 意思是海龟,在Python中显示为一个小箭头,通过它的移动而留下美妙的曲线~~~

1.调用库函数

(1) 导入库函数:import  <库名>

    使用库中函数:<库名> . <函数名> (<函数参数>)

import turtle

turtle.pensize(3)

turtle.forward(250)

(2) 导入库函数:from  <库名>  import * ( *为通配符 )

   使用库中函数:<函数名> (<函数参数>)

from turtle import *

pensize(3)

forward(250)

效果示例:

 

原文地址:https://www.cnblogs.com/alinger/p/10527079.html