Python 3 Turtle Library to Draw Colorful Graphics Shapes & Export it to PNG Image File in Terminal
3K views
Jun 3, 2025
Get the full source code of application here: https://codingshiksha.com/python/python-3-turtle-library-to-draw-colorful-graphics-shapes-export-it-to-png-image-file-in-terminal/
View Video Transcript
0:00
uh hello guys welcome to this video so
0:02
in this video I will show you a
0:05
animation a graphics library of Python
0:09
uh which is called as turtle uh it's a
0:12
very famous library if you want to draw
0:14
some graphics shapes inside your python
0:17
application then you can use this uh
0:19
package alongside with pillow library as
0:22
well so let me show you a very simple
0:24
example let me run this python script so
0:27
what it will do it will uh draw the
0:29
screenshot on the
0:32
window this will draw these concentric
0:35
circles and it will take the screenshot
0:37
as well and save it as a PNG file you
0:40
will see that
0:42
uh it's a very simple example i will
0:44
show you all the source code is given in
0:46
the description so first of all you need
0:48
to install these two packages
0:51
first of all this turtle
0:54
package which is
1:02
a
1:09
turtle and secondly you also need to
1:12
install pillow so I will show you step
1:14
by step here
1:19
so first of all you simply
1:23
import the
1:25
package import turtle and then from this
1:30
pillow library we need to import the
1:33
image after that we set the properties
1:38
around around the screen here we
1:40
initialize a new screen and then we will
1:43
set
1:44
the property around the screen here how
1:48
what is the width so here we can set
1:51
here 1280 and the height 720 and then we
1:55
can even set the background color of
1:57
this screen.bg color and here we can set
2:01
the color to be white so after that we
2:05
can simply initialize a simple shape by
2:10
using this library
2:12
turtle initializing it and then we can
2:15
draw you can set the speed as well and
2:19
then we can set the radius of the circle
2:21
to be around 50 and then we will draw
2:25
the series of circles using this simple
2:27
loop for
2:32
I like this t dot it contains this
2:38
circle and
2:40
then like this
2:57
so I've given all the script in the
2:59
description of the video t dot
3:06
down then after that it actually draws a
3:10
series of circles and we will be
3:13
exporting as a as im image as well by
3:17
using this exporting the canvas to like
3:21
this and
3:24
then saving it as a PNG files
3:29
so so if I execute this now you will see
3:38
that so I have given the full script in
3:42
the description of the video
3:48
so you'll see that it will draw these
3:50
concentric circles and then it will draw
3:54
the
3:56
image so this was a very simple example
3:59
of how to use this turtle package inside
4:03
Python thank you very much for watching
4:05
this video and also check out my website
4:08
freemediattools.com
4:10
uh which contains thousands of tools
#Clip Art & Animated GIFs
#Skins
# Themes & Wallpapers