gui def python

Solutions on MaxInterview for gui def python by the best coders in the world

showing results for - "gui def python"
Mariangel
22 Jan 2016
1# App python gui
2
3import tkinter as tk
4import webbrowser as wb
5
6
7def Facebook():
8    wb.open('facebook.com')
9
10
11def Instagram():
12    wb.open('instagram.com')
13
14
15def Twitter():
16    wb.open('twitter.com')
17
18
19def Youtube():
20    wb.open('youtube.com')
21
22
23def Google():
24    wb.open('google.com')
25
26
27window = tk.Tk()
28window.title('Browser')
29
30google = tk.Button(window, text='Google', command=Google)
31youtube = tk.Button(window, text='Youtube', bg='red', fg='white', command=Youtube)
32twitter = tk.Button(window, text='Twitter', bg='powder blue', fg='white', command=Twitter)
33Instagram = tk.Button(window, text='Instagram', bg='white', fg='black', command=Instagram)
34facebook = tk.Button(window, text='Facebook', bg='blue', fg='white', command=Facebook)
35facebook.pack()
36Instagram.pack()
37twitter.pack()
38youtube.pack()
39google.pack()
40
41window.mainloop()
Elliot
20 Apr 2017
1# main library is tkinter so lets go
2import tkinter as tk
3root = tk.Tk()
4#root.geometry("widthxheight+spcefromleft+spacefromright") lets set h and w
5root.geometry("500x200+0+0")
6# loop your window 
7root.mainloop()
8