{"id":87052,"date":"2023-02-13T09:00:57","date_gmt":"2023-02-13T03:30:57","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=87052"},"modified":"2026-06-03T15:43:44","modified_gmt":"2026-06-03T10:13:44","slug":"python-internet-speed-test","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/","title":{"rendered":"Internet Speed Test &#8211; The Python Powered Internet Speed Tester You Need"},"content":{"rendered":"<p>In this project, we will be creating an Internet Speed Test project using Python&#8217;s Tkinter library and the speedtest module. This project will test the user&#8217;s internet speed and display the results in a user-friendly graphical interface.<\/p>\n<h3>Python Internet Speed Test<\/h3>\n<p>The objective of this project is to teach how to create a simple internet speed test project using Python&#8217;s Tkinter library and the speedtest module. We will go through the process of importing the necessary libraries, creating the user interface, and displaying the test results.<\/p>\n<h3>Prerequisite for Internet Speed Test using Python<\/h3>\n<p>In order to follow this project, you should have a basic understanding of Python programming and Tkinter library. Additionally, you should have the speedtest module installed on your machine. You can install it by running the command <b>pip install speedtest-cli<\/b> in your command prompt.<\/p>\n<h3>Download Python Internet Speed Test Project<\/h3>\n<p>Please download the source code of python Internet Speed Test project from the following link: <a href=\"https:\/\/drive.google.com\/file\/d\/1t08onF_-x17bI9RArwxZ90IumHYPHZEa\/view?usp=drive_link\"><strong>Python Internet Speed Test Code<\/strong><\/a><\/p>\n<h3>Steps to Create Internet Speed Test using Python<\/h3>\n<p>Following are the steps for developing the Python Internet Speed Test project:<\/p>\n<h4>Step 1: Importing Libraries<\/h4>\n<p>Our first step towards creating the Internet Speed Test project will be Importing the required libraries. We will be using the Tkinter library for creating the user interface and the speedtest-cli module for testing the internet speed.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># Importing the required libraries\r\nimport tkinter as tk\r\nimport speedtest\r\n<\/pre>\n<h4>Step 2: Creating the Main Window<\/h4>\n<p>Next, we will create the main window for our app using the Tk() method from the Tkinter library. We will also set the title, background color, and size of the window, and disable the resizing property.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># Creating main window\r\nroot = tk.Tk()\r\n\r\n\r\n# Setting the title, background color and size of the tkinter window and resizing property\r\nroot.title(\"TechVidvan - Internet Speed Test\")\r\nroot.geometry(\"600x358\")\r\nroot.resizable(width=False, height=False)\r\nroot.configure(background=\"#3b4370\")\r\n<\/pre>\n<h4>Step 3: Defining the Speed Test Function<\/h4>\n<p>We will now define a function that will be used to test the internet speed. This function will use the speedtest module to test the download and upload speeds, as well as the ping time. It will also display the results in a user-friendly format.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># function to test internet speed\r\ndef speed_test_command():\r\n    speed_test = speedtest.Speedtest()\r\n    download_speed.config(text=str(round(speed_test.download() \/ 1000000, 2)) + \" Mbps\")\r\n    upload_speed.config(text=str(round(speed_test.upload() \/ 1000000, 2)) + \" Mbps\")\r\n    server_names = []\r\n    speed_test.get_servers(server_names)\r\n    ping.config(text=str(round(speed_test.results.ping, 2)) + \" ms\")\r\n    ip_label.config(text=\"IP Address: \" + str(speed_test.results.client['ip'])+ \", \"+ str(speed_test.results.client['country']))\r\n    server_label.config(text=\"Server: \" + str(speed_test.results.server['sponsor'])+ \", \"+ str(speed_test.results.server['name'])+ \", \"+ str(speed_test.results.server['country']))\r\n    ISP_label.config(text=\"ISP: \" + str(speed_test.results.client['isp']))\r\n<\/pre>\n<h4>Step 4: Creating the UI<\/h4>\n<p>In this step, we will create the user interface for the Internet Speed Test app. We will create labels for the title, download speed, upload speed, and ping. We will also create labels for IP address, server, and ISP.<\/p>\n<p>Here is the code for creating the UI:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># Creating label for title\r\ntitle_label=tk.Label(root)\r\ntitle_label.configure(background=\"#90f090\", foreground=\"#333333\", font=\"Arial 18 bold\", justify=\"center\", text=\"TechVidvan - Internet Speed Test\")\r\ntitle_label.place(x=0,y=0,width=600,height=50)\r\n\r\n\r\n# Creating label for download speed\r\ndownload_label=tk.Label(root)\r\ndownload_label.configure(background=\"#3b4370\", foreground=\"#ffd700\", font=\"Arial 18\", justify=\"center\", text=\"Download Speed\")\r\ndownload_label.place(x=20,y=80,width=160,height=40)\r\n\r\n\r\n# Creating label for download speed\r\ndownload_speed=tk.Label(root)\r\ndownload_speed.configure(background=\"#3b4370\", foreground=\"#ff8c00\", font=\"Arial 28 bold\", justify=\"center\", text=\"0.00 Mbps\")\r\ndownload_speed.place(x=20,y=130,width=160,height=40)\r\n\r\n\r\n# Creating label for ping\r\nping_label=tk.Label(root)\r\nping_label.configure(background=\"#3b4370\", foreground=\"#ffd700\", font=\"Arial 18\", justify=\"center\", text=\"Ping\")\r\nping_label.place(x=220,y=80,width=160,height=40)\r\n\r\n\r\n# Creating label for ping\r\nping=tk.Label(root)\r\nping.configure(background=\"#3b4370\", foreground=\"#ff8c00\", font=\"Arial 28 bold\", justify=\"center\", text=\"0.00 ms\")\r\nping.place(x=220,y=130,width=160,height=40)\r\n\r\n\r\n# Creating label for upload speed\r\nupload_label=tk.Label(root)\r\nupload_label.configure(background=\"#3b4370\", foreground=\"#ffd700\", font=\"Arial 18\", justify=\"center\", text=\"Upload Speed\")\r\nupload_label.place(x=420,y=80,width=160,height=40)\r\n\r\n\r\n# Creating label for upload speed\r\nupload_speed=tk.Label(root)\r\nupload_speed.configure(background=\"#3b4370\", foreground=\"#ff8c00\", font=\"Arial 28 bold\", justify=\"center\", text=\"0.00 Mbps\")\r\nupload_speed.place(x=420,y=130,width=160,height=40)\r\n\r\n\r\n# Creating label for IP address\r\nip_label=tk.Label(root)\r\nip_label.configure(background=\"#3b4370\", foreground=\"#ffffc5\", font=\"Arial 14\", justify=\"center\", text=\"IP Address\")\r\nip_label.place(x=0,y=200,width=600,height=40)\r\n\r\n\r\n# Creating label for server\r\nserver_label=tk.Label(root)\r\nserver_label.configure(background=\"#3b4370\", foreground=\"#ffffc5\", font=\"Arial 14\", justify=\"center\", text=\"Server\")\r\nserver_label.place(x=0,y=230,width=600,height=40)\r\n\r\n\r\n# Creating label for ISP\r\nISP_label=tk.Label(root)\r\nISP_label.configure(background=\"#3b4370\", foreground=\"#ffffc5\", font=\"Arial 14\", justify=\"center\", text=\"ISP\")\r\nISP_label.place(x=0,y=260,width=600,height=40)\r\n\r\n\r\n# Creating button for speed test\r\nspeed_test=tk.Button(root)\r\nspeed_test.configure(font=\"Arial 26\", justify=\"center\", text=\"Speed Test\", command=speed_test_command)\r\nspeed_test.place(x=200,y=300,width=200,height=40)\r\n<\/pre>\n<h4>Step 5: Running the main loop<\/h4>\n<p>In this step, we will run the main loop of the Tkinter window. The mainloop() method is used when your application is ready to run and it tells the code to keep displaying the window until the user closes it.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># Running the main loop\r\nroot.mainloop()\r\n<\/pre>\n<h3>Python Internet Speed Test Output<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-87111 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/python-internet-speed-test-output.webp\" alt=\"python internet speed test output\" width=\"1200\" height=\"772\" \/><\/p>\n<h3>Summary<\/h3>\n<p>Hooray! You have completed this project on creating an internet speed test project using the Tkinter library and the speedtest-cli library in Python. The program allows you to test your internet speed and display the results in an easy-to-read format.<\/p>\n<p>In this tutorial, you learned how to create a GUI, handle user input and interact with the speedtest-cli library to perform the test and display the results. With this knowledge, you can now create your own internet speed test project or modify the existing one to suit your needs.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this project, we will be creating an Internet Speed Test project using Python&#8217;s Tkinter library and the speedtest module. This project will test the user&#8217;s internet speed and display the results in a&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":87110,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1053],"tags":[4853,4854,4855,4856,3335,4857,1094],"class_list":["post-87052","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-internet-speed-test","tag-python-basic-projects","tag-python-internet-speed-test","tag-python-internet-speed-test-project","tag-python-projects","tag-python-projects-for-beginners","tag-python-projects-for-practice"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Internet Speed Test - The Python Powered Internet Speed Tester You Need - TechVidvan<\/title>\n<meta name=\"description\" content=\"Python Internet Speed Test project using Python&#039;s Tkinter library and the speedtest module and displays the test results.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Internet Speed Test - The Python Powered Internet Speed Tester You Need - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Python Internet Speed Test project using Python&#039;s Tkinter library and the speedtest module and displays the test results.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-13T03:30:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-03T10:13:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/02\/python-projects-internet-speed-test.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Internet Speed Test - The Python Powered Internet Speed Tester You Need - TechVidvan","description":"Python Internet Speed Test project using Python's Tkinter library and the speedtest module and displays the test results.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/","og_locale":"en_US","og_type":"article","og_title":"Internet Speed Test - The Python Powered Internet Speed Tester You Need - TechVidvan","og_description":"Python Internet Speed Test project using Python's Tkinter library and the speedtest module and displays the test results.","og_url":"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2023-02-13T03:30:57+00:00","article_modified_time":"2026-06-03T10:13:44+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/02\/python-projects-internet-speed-test.webp","type":"image\/webp"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Internet Speed Test &#8211; The Python Powered Internet Speed Tester You Need","datePublished":"2023-02-13T03:30:57+00:00","dateModified":"2026-06-03T10:13:44+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/"},"wordCount":522,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/02\/python-projects-internet-speed-test.webp","keywords":["internet speed test","python basic projects","python internet speed test","python internet speed test project","Python Projects","python projects for beginners","Python projects for practice"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/","url":"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/","name":"Internet Speed Test - The Python Powered Internet Speed Tester You Need - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/02\/python-projects-internet-speed-test.webp","datePublished":"2023-02-13T03:30:57+00:00","dateModified":"2026-06-03T10:13:44+00:00","description":"Python Internet Speed Test project using Python's Tkinter library and the speedtest module and displays the test results.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/02\/python-projects-internet-speed-test.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/02\/python-projects-internet-speed-test.webp","width":1200,"height":628,"caption":"python projects internet speed test"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/python-internet-speed-test\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Internet Speed Test &#8211; The Python Powered Internet Speed Tester You Need"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/87052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=87052"}],"version-history":[{"count":2,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/87052\/revisions"}],"predecessor-version":[{"id":448116,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/87052\/revisions\/448116"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/87110"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=87052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=87052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=87052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}