URL Shortener Using Python

URL Shortener Using Python

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

Run Python Online

Watch YouTube Video:



Also read:

  • Unveiling the Future of AI Detector
    The rise of AI (Artificial Intelligence) content creation tools, especially ChatGPT, Bard, Jasper, etc., has imposed multiple threats to academia and the search engine world. Now, many students and researchers spend less time on research. Instead, they create content from different AI tools, paraphrase them, find a few relevant studies, and submit them as their … Read more
  • CodeWithHarry Earns 20 Lakhs per month from YouTube?
    CodeWithHarry is a YouTube channel owned by Haris Ali Khan, hailing from Rampur, Uttar Pradesh, India. In 2013, he embarked on his academic journey at the Indian Institute of Technology Kharagpur in West Bengal, where he pursued Industrial & Systems Engineering (ISE), a 5-Year Dual Degree Course. He initiated his YouTube channel on 28 April … Read more
  • Cleaning Service Booking System in Python Tkinter
    Introduction Hello friends, in this article we will see a very simple cleaning service booking system in Python tkinter. This project can not be used in the real world, this just tries to mimic real-world online service applications and that’s why the features of this app are limited. In simple words, you can use this … Read more
  • Farmers Ecommerce App using Python Tkinter
    Introduction Hello friends, I will show you how to create a simple e-commerce app for farmers using Python and the tkinter library in this tutorial. Before anything, let me tell you that this is not a real e-commerce app where anyone can list and buy products like we do on Amazon or Flipkart.Technologies used-> Python, … Read more
  • Guidelines for Project Collaboration Process
    Hi, Thanks for contacting Please send complete details about your project. Whatever features/requirements you want in your project/application/software, please write now, changes/updates later will/may not be entertained Necessary – Tell your budget Payments – You will need to pay according to milestones, let me explain. Let us say, there are 5 tasks in your project, … Read more


Share:
Avatar of Harry

Author: Harry

Hello friends, thanks for visiting my website. I am a Python programmer. I, with some other members, write blogs on this website based on Python and Programming. We are still in the growing phase that's why the website design is not so good and there are many other things that need to be corrected in this website but I hope all these things will happen someday. But, till then we will not stop ourselves from uploading more amazing articles. If you want to join us or have any queries, you can mail me at admin@copyassignment.com Thank you