Creating a cool animated logo in Python can be a lot of fun and the best part is…it is simpler than you think and today we create an animated windows logo with our programming skills and Python.
Before we start with our code. We need one of the most powerful Python animation packages installed in our system, Turtle. To install ‘turtle’ in your PC, simply open PowerShell, type ‘python pip install turtle’ and press Enter.
Now we are ready for our little project!
Here is what the code looks like:
from turtle import *
"""
CREATING THE BLUE SQUARE
"""
speed(1)
bgcolor('black')
penup()
goto(-50, 60)
pendown()
color('#00adef')
begin_fill()
goto(100,100)
goto(100,-100)
goto(-50,-60)
goto(-50,60)
end_fill()
color('black')
goto(15,100)
"""
FORMING THE PARTITIONS AND FINISHING THE WINDOWS LOGO
"""
color('black')
width(10)
goto(15,-100)
penup()
goto(100, 0)
pendown()
goto(-100, 0)
done()
Let’s break it down!
The first part of the code creates a Blue Square which when divided into four equal parts forms the Windows 10 Logo.
speed(): Sets the speed of the drawing pen
bgcolor(): Selects the background color
penup(): Puts the pen up
pendown(): Puts the pen down
goto(): Takes the cursor the specified co-coordinates. If the pen is down, lines are drawn as per the pen’s settings and if the pen is up, the cursor simply moves to those coordinates.
color(): Sets the pen color
begin_fill(): Starts the filling the color inside the boundaries drawn by the pen
end_fill(): Ends the filling process
The second part of the program draws the partitions in the blue square using a thick black line.
width(): Changes the thickness of the pen
CONCLUSION
Not that hard, is it? In just a few minutes, you learnt how to create a Windows Logo using Python all by yourself. Great Job!!!
Give us a LIKE 👍 and FOLLOW, if you like our content and want more. We won’t let you down😉
If you have a doubt, query or any feedback, I would love to learn about it in the comments below👇
You can chat with me and other programmers from our community by joining our telegram group Follow the link and become an important and valued part of our programming community today. See you there!!!
I’ll be back with some new knowledge very soon, until then…..
HAVE AN AMAZING DAY !!!!
0 Comments
Welcome to the comments section, this is where you can contact me personally for any doubts or feedback