![]() ![]() Label(root, text="Enter The Main URL", font="poppins").pack(pady=5)Įntry(root,textvariable=main_url, width =100).pack(pady=5)īutton(root, text="Generate Short URL", command =url_shortner).pack(pady=5) The following is the Python program to create a GUI application for shortening URLs: Now, we will create a Python-based GUI application using Tkinter which will generate short URLs for us. Python Graphical User Interface Application to Generate Short URL URL, it will redirect you to the main URL, i.e., Method accepts the main URL and returns a short URL. For this tutorial, we will be using its TinyURL API. , such as Adf.ly, bitly,, TinyURL, and many more. Now ask the user to enter the URL for which he/she wishes to create a short URL. Let's start with importing the pyshorteners module into our Python script. ![]() Now as we are all set, you need to open your favorite Python IDE or text editor and start coding with me. Run the following pip command on the terminal or command prompt to install the Python We will be using this library to copy the text while creating the GUI Python program to generate a short URL. ![]() Library is used to handle the text characters in the Python program. Run the following pip command on your system's terminal or command prompt to install the pyshorteners library: Library is used to shorten the URL using the TinyURL tool. So, you need to install them for your Python Environment. Pyshorteners (Python Third-Party Library)Īre third-party libraries. In this Python tutorial, we will be using 3 libraries that are as follows: Later, we will also build a GUI application using Python Tkinter for a better user experience.īefore discussing the Python program, let's take a look at the libraries that we need to create the Python program. First, we will write the URL Shortener Python program for the console output. In this Python tutorial, I will walk you through a Python program to create a URL Shortner. This means that you can use the short URL as an alternative to the actual URL. The shortened URL will redirect you to the actual URL. Instead, it will provide you with a new URL that contains the domain name of the URL Shortener Tool and a redirect ID, such as The short URL will not contain the actual URL details. Well, a URL shorting tool accepts a page URL and provides you with a short version of that URL. You have also seen that most of the malicious cyber link attacks also use the shorter URL tool to short the URL link so the user cannot see the actual redirect link. Sometimes the web URL for a page is too long and complicated to share, so we use URL shorting tools like ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |