-
Notifications
You must be signed in to change notification settings - Fork 0
/
bookmark_app.py
38 lines (31 loc) · 1013 Bytes
/
bookmark_app.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
34
35
36
37
import tkinter as tk
import webbrowser
#assign web links variables
def click_facebook(event):
webbrowser.open_new_tab("https://facebook.com")
def click_amazon(event):
webbrowser.open_new_tab("https://amazon.com")
def click_instagram(event):
webbrowser.open_new_tab("https://instagram.com")
window = tk.Tk()
#create a window
window.geometry("400x200")
#create a button
button = tk.Button(window, text="Facebook")
button1 = tk.Button(window, text="Amazon")
button2 = tk.Button(window, text="Instagram")
alabel = tk.Label(text= "News Feed")
#putting the button in which column/row
alabel.grid(column=0, row=0)
#bind button to Facebook
button.bind("<Button-1>",click_facebook)
button.grid(column=0)
blabel = tk.Label(text= "Shopping Page")
blabel.grid(column=1, row=0)
button1.bind("<Button-1>",click_amazon)
button1.grid(column=1, row=1)
clabel = tk.Label(text= "Front Page")
clabel.grid(column=2, row=0)
button2.bind("<Button-1>",click_instagram)
button2.grid(column=2, row=1)
window.mainloop()