Drawing using python

March has been to Wuhan cherry blossom about to usher in the day, closed city a month has passed, still no signs of human habitation on the street, some doomed the coming of spring long.

Wuhan City of us miss those days are free to go out; those days do not need to wear masks; those who can after work, drink a toast bites of the day, miss the freedom that can be at home anywhere in front of cherry blossoms .

So today with self-turtle painting

Draw a cherry tree in Python draw

When the cherry blossoms are not open, we line co-kun, when the cherry blossoms in full bloom, we meet Luojia mountain!

Hope to the party more than the cherry, as well as after the outbreak of peace you!

1 common instruction

Today, the use of python draw cherry trees, need to use turtle graphics, corresponding to the turtle python library Here are some common turtle drawing commands:

 

2 coding

Know some common commands, you can start drawing the cherry tree

First, let's write a function to draw the trunk of cherry

 Drop function petals

 

 Then we create a canvas, then you can begin to draw cherry trees in it

 Last seen cherry trees is this effect

 

Guess you like

Origin www.cnblogs.com/oldfish123/p/12393308.html