Turtle graphics programming in python

Using python’s tkinter module we can create a logo style programs. To do this in python import the module tkinter. Draw the class turtle. Initialize the turtle class with coordinates and angle. Write a function draw_turtle. Draw three straight lines to form a triangle. Write another function delete_turtle to delete the lines. To move forward write mv_fwd function with a parameter ‘distance’. In this function first delete the turtle, draw a line to that distance and redraw the turtle. Preserve the angle.

Turtle graphics in python

Visit my github location for source code – http://github.com/abhilashak/logo_in_python

To rotate write rt_lt and rt_rt functions. First delete the existing turtle. From the angle this function calculates the position of new turtle. Redraw it.  rt_rt is just the negative angle of rt_lt.

Author: Abhilash

Hey! This is Abhilash - A Ruby developer, specialised on web development. I am also working on other frameworks such as Angular, Sinatra, Laravel, NodeJS etc. Ruby On Rails is my primary software framework, which I do since 2010. This blog is about Ruby, Ruby On Rails and other subjects that I have had experienced upon. You can contact me here: abhilash.amballur@gmail.com LinkedIn: www.linkedin.com/in/abhilashak

2 thoughts on “Turtle graphics programming in python”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: