Draw simple animals with python

silencement
Release: 2019-06-05 09:23:37
Original
14914 people have browsed it

Draw simple animals with python

Use python to draw simple pictures, which are drawn using the turtle library. Turtle is translated into Chinese as turtle. Turtle controls pixel coordinates through various functions to move forward, backward, change directions, etc. Operation, set the brush color and fill color through functions to outline and fill in colors.

The main function of turtle module

##Function nameFunctionturtle.pensize()Set the brush sizeturtle.hideturtle()Hide brusht.speed()Set the speed of the brush, parameter range is 0~10##t .penup()t.pendown()t.seth()t.begin_fill()t.end_fill()t.fd()t.bd()t.pencolor()t.fillcolor()t .circle()
Start writing, there will be no pictures when moving
Putting down the pen, there will be pictures when moving
Set the direction of the brush to a certain degree, 0-east; 90-north; 180-west; 270-south
Start drawing
End drawing
Move the specified distance towards the direction of the brush, the parameter is the distance
Move the specified distance in the opposite direction of the brush, the parameter is the distance
Set the color of the brush, the parameter is RGB format or Color name
Set the fill color, the parameter is RGB format or color name
Set a circle with a specified radius, and the parameter is the radius.

The above is the detailed content of Draw simple animals with python. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!