Draw a Circle in Python Turtle: Arcs, Fills and Polygons

Python turtle circle: the turtle graphics window showing a blue circle drawn with a radius of 100

To draw a circle in Python turtle, call circle() with a radius: The surprise is where it lands. It’s drawn above the turtle rather than around it, and the next section shows why. Every screenshot here is a real turtle window on Python 3.12.5. Drawing a circle in Python turtle One call does it. The … Read more >>

Python Turtle Speed: Animation Speed

turtle speed python

Recently, I was working on a Python Turtle graphics project where I needed to control how fast the animations were running. The issue is, getting the right speed can make a huge difference in how your turtle graphics appear to users. In this article, I’ll cover everything you need to know about controlling the speed … Read more >>

Python Turtle Colors: Full Colors List, RGB, Hex and colormode

Python Turtle colors: chart of 147 named colours plus hex, RGB, colormode, random colours and gradients

Python Turtle accepts colours in three forms: a name such as “tomato”, a hex code such as “#1e90ff”, or an RGB tuple such as (46, 139, 87). Set the line colour with pencolor(), the fill with fillcolor(), both at once with color(), and the window with screen.bgcolor(). Below is the full chart of the 147 … Read more >>

How to Add an Image to Python Turtle (GIF, PNG and Background)

Attach an image to Python Turtle: rocket image shapes rotated in eight directions

To attach an image to a Python Turtle, register the image as a shape with screen.register_shape(“rocket.gif”) and then call t.shape(“rocket.gif”). Up to Python 3.13 that shortcut only accepts GIF files; PNG works too, but through tkinter.PhotoImage (shown below), and Python 3.14 adds PNG to register_shape() directly. This guide also covers background images, resizing, making images … Read more >>

Build Snake Game in Python Using Turtle Module

turtle snake

Recently, I was helping my nephew learn Python programming, and I wanted to create something that would keep him engaged and excited. What better way than creating a classic Snake game? Using Python’s Turtle module, we can easily build this nostalgic game that many of us played on our old Nokia phones. In this tutorial, … Read more >>

Python Turtle: Draw Shapes

draw circle using turtle programming

Recently, I was teaching a beginner Python class where students were struggling to visualize programming concepts. That’s when I turned to the Turtle module, a perfect gateway into Python programming that makes learning visual and fun. In this article, I’ll share everything you need to know about drawing shapes using Python’s Turtle module. The Turtle … Read more >>

Python Scipy Convolve 2d: Image Processing

convolve2d

Recently, I was working on an image processing project where I needed to apply various filters to detect edges and blur certain areas. The scipy.signal.convolve2d function became my go-to tool for these operations. In this article, I’ll share how to effectively use this powerful function for image processing in Python. Whether you’re working on computer … Read more >>

Python SciPy Leastsq: Solve Non-Linear Least Squares Problems

scipy optimize least squares

I was working on a data analysis project where I needed to fit a complex exponential decay model to experimental measurements. The challenge was that my model was non-linear, making traditional linear regression methods unsuitable. This is where SciPy’s leastsq function came to the rescue. In this article, I’ll share how to use SciPy’s leastsq … Read more >>

Python Scipy Odeint: Solve Differential Equations

odeint python

While I was working on a project that required solving differential equations to model a real-world physical system. The challenge was finding a simple yet useful way to solve these equations in Python. That’s when I discovered the scipy.integrate.odeint function, a game-changer for solving ordinary differential equations (ODEs) numerically. In this article, I’ll cover several … Read more >>

Python SciPy Interpolate

scipy interpolate

When working with real-world data, it’s common to encounter situations where you need to estimate values between known data points. This is where interpolation comes in handy, and Python’s SciPy library offers powerful tools for this purpose. Over my decade-plus journey as a Python developer, I’ve found SciPy’s interpolation functions to be invaluable for various … Read more >>