Internet Speed Test App

 Internet Speed Test App (Tkinter GUI)


This Python program creates a simple Internet Speed Test application using the Tkinter library for the graphical user interface and the speedtest module to measure internet speed.


When the user clicks the “Check Speed” button, the program connects to the nearest Speedtest.net server to measure both download and upload speeds. The results are displayed on the window in Mbps (Megabits per second).

---Features:

🎨 User Interface:

Built with Tkinter, featuring a pink background and white display boxes for clear visibility.

⚡ Download & Upload Speed Measurement:

Uses the speedtest library to check your internet speed in real time.

🔘 One-Click Testing:

A single “Check Speed” button triggers the test and updates the labels with accurate results.

---

How It Works:


1. The app window (500×500) opens with labels for Download and Upload speed.

2. When you click “Check Speed”, the speedcheck() function runs.

3. It uses speedtest.Speedtest() to:Connect to nearby servers.

Measure download speed (st.download()).

Measure upload speed (st.upload()).

4. The results are rounded to two decimal places and displayed in Mbps.



Code

from tkinter import *

import speedtest

sp = Tk()

sp.title("speedtest")

sp.geometry("500x500")

sp.config(bg="pink")

def speedcheck():

 st = speedtest.Speedtest()

 st.get_servers()

 down = str(round(st.download()/(10**6),2))+"Mbps"

 up = str(round(st.upload()/(10**6),2))+"Mbps"

 lab_down.config(text=down)

 lab_up.config(text = up)

lab = Label(sp, text="Speed test",bg="white")

lab.place(x=50,y=40,height="50",width="380")

lab = Label(sp, text="Download",bg="white")

lab.place(x=50,y=100,height="50",width="380")

lab_down = Label(sp, text="00",bg="white",fg="red")

lab_down.place(x=50,y=160,height="50",width="380")

lab = Label(sp, text="Upload",bg="white")

lab.place(x=50,y=220,height=50,width=380)

lab_up = Label(sp, text="00",bg="white",fg="red")

lab_up.place(x=50,y=280, height=50,width=380)

button = Button(sp, text="Check Speed",bg="red" , command=speedcheck)

button.place(x=50,y=350, height=50,width=380)

sp.mainloop()



---


Requirements:


Install the required library using:


pip install speedtest-cli

Comments

Popular posts from this blog

Dice game

Rock paper scissors

Maths Problem Generator