URL Shortener Using Python In Hindi
Introduction:
हेलो दोस्तों आज की इस पोस्ट में मैं आपको बताने वाला हूं कि आप किस तरीके से Python Programming Language की मदद से अपना खुद का एक URL Shortener कैसे बना सकते हैं | तो अगर आप भी इसके बारे में जानना चाहते हैं तो आप इस पोस्ट को अंत तक पढ़े और ध्यान से पढ़ें और कुछ समझ में आ जाए |
Library Installation
दोस्तों इस प्रोजेक्ट को करने के लिए हमें एक Python Library की जरूरत पड़ेगी जिसका नाम है pyshorteners तो आपको इस लाइब्रेरी को अपने System (Computer) में Install करना है Install करने के लिए आप pip command का यूज कर सकते हैं |
pip install pyshorteners
Code for Creating URL Shorteners Using Python:
import pyshorteners
link=input("Enter the Link:")
shortener=pyshorteners.Shortener()
shorted_link=shortener.tinyurl.short(link)
print(shorted_link)
Explanation:
1. सबसे पहले हमने pyshorteners लाइब्रेरी को Import कराया है ताकि हम इसके अंदर के Function को Use कर सकें |
2. और उसके बाद हमने एक link नाम का Variable बनाया है जिसमें की User एक URL को इनपुट करेगा |
3. उसके बाद हमने एक shortener नाम का variable बनाया है और इसके अंदर हमने लिखा है pyshoteners.Shortener() और यहां पर जो "Shortener()" है वह एक Function है जो कि हम इस pyshoteners वाली लाइब्रेरी में से ले रहे हैं तो इस पूरे function को हमने एक shortener नाम के Variable में रख दिया है |
4. और उसके बाद हमने एक shorted_link के नाम से Variable बनाया है और इसके अंदर हम Final Shorted URL Store करेंगे तो इसके लिए हमने लिखा है "shortener.tinyurl.short" जिसकी मदद से URL short होगा और इसके अंदर हमने link नाम के variable को पास किया है जिसमें की User अपना URL इनपुट करेगा |
5. और उसके बाद हमने shorted_link को Print कर दिया है |
Output:
Enter the Link:https://www.youtube.com/channel/UCu5dKasi8jWQ8fNMIyQS05g
https://tinyurl.com/y9l3wkpo
Summary:
तो दोस्तों इस तरीके से आप Python Programming Language की मदद से अपना खुद का एक URL Shortener बना सकते हैं वह भी सिर्फ Python की 5 लाइन के कोड में | तो अगर आपको यह प्रोजेक्ट पसंद आया तो आप हमें कमेंट करके जरूर बताएं और अगर आप इसी तरह के और भी Python Projects के बारे में जानना चाहते हैं तो आप हमें फॉलो करें और हमारे YouTube Channel CodeWithShani को जरूर सब्सक्राइब करें |
Read Alse:
Tags :
#pythonproject #python #coding #coder #programming #programmer #pythonlanguage #pythonprogramming #computer #computerscience #trending #projects #codewithshani #code_with_shani #ebook #java #javascript #clanguage #cprogramming #react #js #converter #howto #how #usingpython #hindi #inhindi #shanibhai #codergirl #coderlife #coderpower #coders #coderslife #codingbootcamp #codingishun #codinglife #programacian #pythoncoder #programmerlife #code #python3 #pythonhub #developer #development #html ##webdevelopment #website #linux #css #bootstrap #project #url #shortener #make
0 टिप्पणियाँ
If you have any Doubt, So Please Let me Know