-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpython_tkinter
More file actions
50 lines (38 loc) · 1.44 KB
/
python_tkinter
File metadata and controls
50 lines (38 loc) · 1.44 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
# =================================================================
# Create your first Graphical User Interface using Python + Tkinter
# Version 1 (Basic)
# Truzz Blogg - https://youtu.be/RSrMViS246Q
# =================================================================
# Let's import tkinter
import tkinter as tk
# Create instance
mywindow = tk.Tk()
# Let's create our title
mywindow.title("Python TRUZZBLOGG GUI")
mywindow.geometry("400x200")
#mywindow.resizable(False,False)
# Launch the application (preventing closing: mainloop method)
mywindow.mainloop()
# =================================================================
# Create your first Graphical User Interface using Python + Tkinter
# Version 2
# Truzz Blogg - https://youtu.be/RSrMViS246Q
# =================================================================
# Let's import tkinter + messagebox
import tkinter as tk
from tkinter import messagebox
# You can also try the next sentence:
# import tkinter.messagebox
# Create instance
myWindow = tk.Tk()
myWindow.title(" Buttons and Message Boxes - TRUZZBLOGG")
myWindow.geometry("400x400")
# Create a function to manage dialog box we are going to generate
def myMessage():
messagebox.showinfo("Question!!!", "My question is... ")
# Create a button
btn1 = tk.Button(myWindow, text = "1st Button", command = myMessage)
#btn1.pack()
btn1.place(x=75, y=50)
# Launch the application (preventing closing: mainloop method)
myWindow.mainloop()