-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImportingHomework2.py
99 lines (73 loc) · 2.35 KB
/
ImportingHomework2.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#tkinter
import tkinter as tk
import time as t
global lbl1, e, slider, btn1, x, Qcount, Questions, window, btn1 #, Bclicks, ButtonClicks, b
x=0
window = tk.Tk()
window.title("my box gui")
window.iconbitmap('target_goal_icon_152113.ico')
window.geometry("400x400") #width x height
Questions = ['Hello, what should I call you1?','How old are you2?', 'What is your favorite sport?3',
'How many brothers and sisters do you have4?',
'Do you like classical music5?', 'Have you studied at University6?',
'Do you like ice cream7?', 'How are you feeling today8?']
x = 0
Qcount = Questions[x]
lbl1 = tk.Label(window,text=Qcount)
lbl1.place(x=20, y=20)
lbl1.pack(pady=10)
e = tk.Entry(window, width=50, fg='blue')
e.place(x=50, y=50)
e.pack(pady=10)
def btnReset():
global name, btn1
name = e.get()
btn1.pack_forget()
print(name)
# lbl1.pack_forget()
# lbl1 = tk.Label(window, text=Questions[x])
# lbl1.pack(pady=10)
# btn1.pack_forget()
# btn1 = tk.Button(window, text="Submit", command= btnClick() , fg= 'black', bg='#33FFC4', padx=40, pady=20)
# btn1.pack()
slider = tk.Scale(window,from_=0, to=100)
slider.pack()
global btn1
btn1 = tk.Button(window, text="Submit", command= btnReset() , fg= 'black', bg='#33FFC4', padx=10, pady=0)
btn1.pack()
window.mainloop()
#status = tk.Label(window, text= "Question 1" of 8")
# click1()
# b+=1
# btn1 = tk.Button(window, text="Submit", command= Bclicks, fg= 'black', bg='#33FFC4', padx=40, pady=20)
# btn1.pack()
# def lbl1Erase():
# lbl1.pack_forget()
# click1()
# def click1():
# global name
# global lbl1
# global btn1
# global x
# global Qcount
# lbl1 = tk.Label(window, text='Welcome to the program ' + e.get() +"\n" + Qcount)
# lbl1.pack(pady=20)
# x += 1
# btnClick()
# def click2():
# global lbl1
# global age
# lbl1.pack_forget()
# lbl1 = tk.Label(window, text=Qcount)
# lbl1.pack(pady=20)
# if age < 18:
# print("Sorry, you're not old enough to use this program. Please try again after you've turned 18.")
# exit()
# else:
# slider.pack_forget()
# btn1.pack_forget()
# lbl1.pack_forget()
# lbl1 = tk.Label(window, text="Good to see that you are old enough. Let's get started")
# lbl1.pack(pady=20)
# btnClick()
#window.mainloop()