-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditor.py
More file actions
executable file
·45 lines (29 loc) · 919 Bytes
/
editor.py
File metadata and controls
executable file
·45 lines (29 loc) · 919 Bytes
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
import pygame, PIL
# Program by Andrew Church
# I found out how to do everything by GeeksForGeeks
from tkinter import *
# defining functions
def clicked():
# changes the label
lbl.configure(text='Hello '+txt.get())
# setting basic window information
root = Tk()
root.geometry('400x400')
root.title('Hello World')
# making a label
lbl = Label(root,text="Hello World (Label Edition)")
lbl.grid() # placing a label down
# making a button
btn = Button(root,text="Submit", fg='red', command=clicked)
btn.grid(column=2,row=0)
# making text
txt = Entry(root,width=10)
txt.grid(column=1, row=0)
# adding menu bar
menu = Menu(root)
item = Menu(menu) #an item, a submenu, in the menu
item.add_command(label="New") #adds the new command
menu.add_cascade(label="File",menu=item) #adds item to be a menu that shows up if you click the "File" menu
root.config(menu=menu)
# starting the app
root.mainloop()