-
Notifications
You must be signed in to change notification settings - Fork 0
/
nintyFirst.py
42 lines (34 loc) · 930 Bytes
/
nintyFirst.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
38
39
40
41
42
from Tkinter import *
root = Tk()
L = []
def file_submission_ADD():
global L
L.append(display.get() + '\n')
display.delete(0, END)
def file_submission_SAVE():
global L
with open("text_submission_GUI.txt", "a+") as fp:
L.append(display.get() + '\n')
for i in L:
fp.write(i)
fp.close()
L = []
display.delete(0, END)
def file_submission_SAVE_and_CLOSE():
global L
with open("text_submission_GUI.txt", "a+") as fp:
L.append(display.get() + '\n')
for i in L:
fp.write(i)
fp.close()
L = []
root.destroy()
label1 = Button(root, text="Add File", command=file_submission_ADD)
label2 = Button(root, text="Add and Save", command=file_submission_SAVE)
label3 = Button(root, text="Save and Close", command=file_submission_SAVE_and_CLOSE)
display = Entry(root)
label1.grid(row=0, column=1)
label2.grid(row=0, column=2)
label3.grid(row=0, column=3)
display.grid(row=0, column=0)
root.mainloop()