-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurl.py
33 lines (25 loc) · 960 Bytes
/
url.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import sys
from tkinter import *
from webbrowser import *
#----------------------------------------------------------------------------------------------------------------
tab = Tk()
g1int= StringVar()
tab.title("MINI URL")
tab.geometry('300x150')
#----------------------------------------------------------------------------------------------------------------
def opn_url():
g2int = g1int.get()
type(g2int)
try:
webbrowser.open(g2int)
except:
tab_1 = tk()
tab_1.title('error')
tab_1.geometry('150x150')
lbl_2 = Label(tab_1, text = "Invalid inputs").pack()
#----------------------------------------------------------------------------------------------------------------
#GUI with tkinter
lbl_1 = Label(tab, text = "GET SITE").pack()
g_entry = Entry(tab, textvariable = g1int).pack()
button_1 = Button(tab, text = "SEARCH", fg = "red", command = opn_url).pack()
tab.mainloop()