Create a Python-based Internet Speed Test GUI App: A Guide

Create a Python-based Internet Speed Test GUI App: A Guide

Published at - Sep 30, 2021

Whenever we face an internet issue, the first thing we do is an internet speed test. So I have decided to create a Python app to check ping tests and your download speed. I have used pyspeedtest to use internet speed and Tkinter for GUI interface.

To use those packages in our application, first, we need to install them in our system. :)

pip install pyspeedtest
sudo apt-get install python3-tk

To learn more about pyspeedtest, you can refer to the official documentation here.

Exploring options

Check speed

$ pyspeedtest
Using server:
Ping: 9 ms
Download speed: 148.17 Mbps
Upload speed: 18.56 Mbps

Testing from a Python script:

>>> import pyspeedtest
>>> st = pyspeedtest.SpeedTest()
>>> st.upload()

Creating GUI app

create file and paste the following code

import pyspeedtest
from tkinter import *
def Speed_test():
speedTest = pyspeedtest.SpeedTest(textArea.get())
master = Tk()
myping = StringVar()
down = StringVar()
Label(master, text="Enter Website URL to ping").grid(row=0, sticky=W)
Label(master, text="Ping test result in ms:").grid(row=3, sticky=W)
Label(master, text="Download test result in bps:").grid(row=4, sticky=W)
pingResult = Label(master, text="", textvariable=myping, ).grid(row=3, column=1, sticky=W)
downloadResult = Label(master, text="", textvariable=down, ).grid(row=4, column=1, sticky=W)
textArea = Entry(master)
textArea.grid(row=0, column=1)
b = Button(master, text="Cheak", command=Speed_test)
b.grid(row=0, column=2, columnspan=2, rowspan=2, padx=5, pady=5)


To run the following application, you need to run python3 If python3 is not installed in your system, you need to install Python first. After running python3, it will launch a GUI interface for the speed test.

Now you can enter server addresses such as or t and hit the check button to start testing your internet speed. It will show you ping speed in ms (milliseconds) and your download speed in bps (bits per second).

So, in this Python app tutorial, we learned about pyspeedtest and Tkinter to create a GUI app. Tkinter is a widely used package to create GUI apps in python if you want to learn more about it in detail please refer to this link.

I hope it will help you to boost your knowledge and if you like this post please clap for it. It will motivate me to write more content. Thank you for reading.

Related Posts -

Python program to send mail using gmail smtp - python coding
Python program to send mail ...

In this lesson on python coding, we will learn how to send mail using Gmail...

Python gui desktop app to download youtube video - python coding
Python gui desktop app to d ...

Hello Guys, Today I am going to create a youtube downloader GUI app to down...

Follow Us

Follow us on facebook Click Here

Facebook QR
Scan from mobile
Join our telegram channel Click Here
Telegram QR
Scan from mobile