From e98296cb29e890c6d8b25363a547fae545f44ddc Mon Sep 17 00:00:00 2001 From: Prathima Kadari <74645302+prathimacode-hub@users.noreply.github.com> Date: Sat, 10 Apr 2021 23:51:27 +0530 Subject: [PATCH 1/2] Create README.md --- URLShortener/README.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 URLShortener/README.md diff --git a/URLShortener/README.md b/URLShortener/README.md new file mode 100644 index 0000000..da47793 --- /dev/null +++ b/URLShortener/README.md @@ -0,0 +1,7 @@ +This is a python script of URL Shortener. + +It shortens the URL using 'Generate Short URL' button. + +For that, URL should be entered in the required space. + +It's a task which most people use it in day to day lives. From f6f36acf1e70b3691df6d4a83e030dc7024ae577 Mon Sep 17 00:00:00 2001 From: Prathima Kadari <74645302+prathimacode-hub@users.noreply.github.com> Date: Sat, 10 Apr 2021 23:51:49 +0530 Subject: [PATCH 2/2] Add files via upload --- URLShortener/URLShortener.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 URLShortener/URLShortener.py diff --git a/URLShortener/URLShortener.py b/URLShortener/URLShortener.py new file mode 100644 index 0000000..3f4a9c4 --- /dev/null +++ b/URLShortener/URLShortener.py @@ -0,0 +1,27 @@ +import pyperclip +import pyshorteners +from tkinter import* + +root=Tk() +root.geometry("400x200") +root.title("URL Shortener") +root.configure(bg="#49A") +url=StringVar() +url_address=StringVar() + +def urlshortner(): + urladdress=url.get() + url_short=pyshorteners.Shortener().tinyurl.short(urladdress) + url_address.set(url_short) + +def copyurl(): + url_short=url_address.get() + pyperclip.copy(url_short) +Label(root,text="My URL Shortener", font="poppins").pack(pady=10) +Entry(root, textvariable=url).pack(pady=5) +Button(root, text="Generate Short URl", command=urlshortner).pack(pady=7) +Entry(root, textvariable=url_address).pack(pady=5) +Button(root, text="Copy URL", command=copyurl).pack(pady=5) + +root.mainloop() +