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


Watch YouTube Video:



Also read:

  • People are becoming AI Engineer with this free course in 2025: Here is how to join this…
    Artificial Intelligence (AI) has become a cornerstone of technological advancement, shaping industries and transforming careers. If you’ve been looking to upskill or dive into the fascinating world of AI, freeCodeCamp.org has released an incredible resource: the AI Foundations Course on YouTube. This 11-hour video, created by @LunarTech_ai, is not just another crash course – it’s…
  • Apply to Google’s Student Training in Engineering Program (STEP) Intern, 2025
    Google’s Student Training in Engineering Program (STEP) Intern, 2025, is a fantastic opportunity for students passionate about programming and software development. Designed to support skill-building and career growth, this program offers a chance to work with one of the world’s leading tech companies. Here’s everything you need to know about this internship opportunity. What Is…
  • Self-Driving Car Saves Falling Pedestrian, Showcases Promise of Autonomous Technology
    In a dramatic demonstration of the potential for self-driving technology to enhance road safety, a Waymo’s autonomous vehicle recently avoided a serious accident when a scooter rider, startled by a pothole, lost balance and fell onto the road. The incident, captured on video, highlights the advanced capabilities of modern driverless technology. As the rider tumbled…
  • Instant Karma: Employer Fires Tech Team with AI, Faces Backlash on LinkedIn While Seeking New Developers
    In a bold—and controversial—move, Canadian software developer Wes Winder has sparked heated online debates after replacing his entire development team with Artificial Intelligence (AI). Winder, who took to LinkedIn to announce his decision, has been met with a wave of criticism and ridicule, with many questioning the practicality and ethics of his approach. The Controversial…
  • LinkedIn’s COO Reveals the AI Interview Question That Could Land You the Job in 2025
    In a world where Artificial Intelligence (AI) is reshaping the workplace and redefining job roles, LinkedIn’s Chief Operating Officer, Dan Shapiro, believes there’s one interview question that could set you apart from the competition. During a recent keynote on the future of work, Shapiro emphasized the growing importance of AI in both personal and professional…


Share:

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