
Python makes it easy to do anything in IT field.
Today we will use Python to short any URL.
We will be using “pyshorteners” module from Python.
You can install by typing "pip install pyshorteners"
inside terminal.
There is nothing big to explain here, as Python makes most of the code too short and the same is here.
We are using "pyshorteners"
which shorts any URL we give to the program.
Code
import pyshorteners url = input("Enter your url") s = pyshorteners.Shortener().tinyurl.short(url) print("Your shorted is -->", s)
Output
Enter your url-->https://copyassignment.com/ Your shorted is --> http://tinyurl.com/ycnqto68
Watch YouTube Video:
Also read:
- Top 25 Pattern Programs in C++In this article, I will show you the Top 25 Pattern Programs in C++ that you must learn which will help you to understand the usage of nested loops. We will learn to create different geometrical shapes like Squares, triangles, Rhombus, etc. We have provided the code as well as output for all the patterns…
- Currency Converter in C++In this article, we will build a simple program for Currency Converter in C++. The user will be able to convert currencies like Dollar, Euro, Pound, and Rupee. This is a console application and very simple to understand as we only use a bunch of conditionals to write the entire program. Features Users can convert…
- SQLite | CRUD Operations in PythonCRUD stands for Create Read Update Delete. I will show you how to perform CRUD Operations in Python. You need basic Tkinter and SQLite knowledge before you read further. This app is straightforward, when you will open this app, a GUI with 4 green colored buttons will open to perform CRUD(create read update delete) operations….
- Number Guessing Game in C++In this article, we will build a simple Number Guessing Game in C++. It’s a game in which the player has to guess a secret number in a range that is generated by the computer and upon a wrong guess by the player, the game will give hints to the player to guess the correct…
- Image background remover in PythonHello friends, in this article, we will learn how to create an Image background remover in Python. I will first show you a simple program and then you will see a smile GUI made using tkinter. We need to install rembg, you can install rembg using the pip command: Image background remover in Python program…