PTE.py 11 KB
Newer Older
Matheus Muller's avatar
Matheus Muller committed
1
import Tkinter as tk
2
3
from PTEdict import *
from Eprop import atomsubmenu
Matheus Muller's avatar
Matheus Muller committed
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
# PTE building

def PTable(Elem , Elembut):

    ####################################################
    # Returns element parameters on click

    def atomdef(atom, Ele, Eleb):
        Eleb['text'] = atom['symbol']
        Ele['name'] = atom['name']
        Ele['mass'] = atom['mass']
        Ele['Z'] = atom['Z']
        Ele['symbol'] = atom['symbol']
        master.destroy()
        atomsubmenu(Elem, Elembut)

    master = tk.Tk()
    master.title('Periodic Table of Elements')
    
    ####################################################
    
    q1 = lambda: atomdef(H, Elem, Elembut)
    b1 = tk.Button(master, text="H", command=q1, width=1, height=1, bg='white')
    b1.pack()
    
    q2 = lambda: atomdef(He, Elem, Elembut)
    b2 = tk.Button(master, text="He", command=q2, width=1, height=1, bg='pink')
    b2.pack()
    
    q3 = lambda: atomdef(Li, Elem, Elembut)
    b3 = tk.Button(master, text="Li", command=q3, width=1, height=1, bg='yellow')
    b3.pack()
    
    q4 = lambda: atomdef(Be, Elem, Elembut)
    b4 = tk.Button(master, text="Be", command=q4, width=1, height=1, bg='brown')
    b4.pack()
    
    q5 = lambda: atomdef(B, Elem, Elembut)
    b5 = tk.Button(master, text="B", command=q5, width=1, height=1, bg='blue')
    b5.pack()
    
    q6 = lambda: atomdef(C, Elem, Elembut)
    b6 = tk.Button(master, text="C", command=q6, width=1, height=1, bg='green')
    b6.pack()
    
    q7 = lambda: atomdef(N, Elem, Elembut)
    b7 = tk.Button(master, text="N", command=q7, width=1, height=1, bg='green')
    b7.pack()
    
    q8 = lambda: atomdef(O, Elem, Elembut)
    b8 = tk.Button(master, text="O", command=q8, width=1, height=1, bg='green')
    b8.pack()
    
    q9 = lambda: atomdef(F, Elem, Elembut)  
    b9 = tk.Button(master, text="F", command=q9, width=1, height=1, bg='red')
    b9.pack()
    
    q10 = lambda: atomdef(Ne, Elem, Elembut)
    b10 = tk.Button(master, text="Ne", command=q10, width=1, height=1, bg='pink')
    b10.pack()

    q11 = lambda: atomdef(Na, Elem, Elembut)
    b11 = tk.Button(master, text="Na", command=q11, width=1, height=1, bg='yellow')
    b11.pack()

    q12 = lambda: atomdef(Mg, Elem, Elembut)
    b12 = tk.Button(master, text="Mg", command=q12, width=1, height=1, bg='brown')
    b12.pack()
Matheus Muller's avatar
Matheus Muller committed
74
 
75
76
77
    q13 = lambda: atomdef(Al, Elem, Elembut)
    b13 = tk.Button(master, text="Al", command=q13, width=1, height=1, bg='purple')
    b13.pack()
Matheus Muller's avatar
Matheus Muller committed
78

79
80
81
    q14 = lambda: atomdef(Si, Elem, Elembut)
    b14 = tk.Button(master, text="Si", command=q14, width=1, height=1, bg='blue')
    b14.pack()
Matheus Muller's avatar
Matheus Muller committed
82

83
84
85
    q15 = lambda: atomdef(P, Elem, Elembut)
    b15 = tk.Button(master, text="P", command=q15, width=1, height=1, bg='green')
    b15.pack()
Matheus Muller's avatar
Matheus Muller committed
86

87
88
89
    q16 = lambda: atomdef(S, Elem, Elembut)
    b16 = tk.Button(master, text="S", command=q16, width=1, height=1, bg='green')
    b16.pack()
Matheus Muller's avatar
Matheus Muller committed
90

91
92
93
    q17 = lambda: atomdef(Cl, Elem, Elembut)
    b17 = tk.Button(master, text="Cl", command=q17, width=1, height=1, bg='red')
    b17.pack()
Matheus Muller's avatar
Matheus Muller committed
94

95
96
97
    q18 = lambda: atomdef(Ar, Elem, Elembut)
    b18 = tk.Button(master, text="Ar", command=q18, width=1, height=1, bg='pink')
    b18.pack()    
Matheus Muller's avatar
Matheus Muller committed
98

99
100
101
    q19 = lambda: atomdef(K, Elem, Elembut)
    b19 = tk.Button(master, text="K", command=q19, width=1, height=1, bg='yellow')
    b19.pack()
Matheus Muller's avatar
Matheus Muller committed
102

103
104
105
    q20 = lambda: atomdef(Ca, Elem, Elembut)
    b20 = tk.Button(master, text="Ca", command=q20, width=1, height=1, bg='brown')
    b20.pack()
Matheus Muller's avatar
Matheus Muller committed
106

107
108
109
    q21 = lambda: atomdef(Sc, Elem, Elembut)
    b21 = tk.Button(master, text="Sc", command=q21, width=1, height=1)
    b21.pack()
Matheus Muller's avatar
Matheus Muller committed
110

111
112
113
    q22 = lambda: atomdef(Ti, Elem, Elembut)
    b22 = tk.Button(master, text="Ti", command=q22, width=1, height=1)
    b22.pack()
Matheus Muller's avatar
Matheus Muller committed
114

115
116
117
    q23 = lambda: atomdef(V, Elem, Elembut)
    b23 = tk.Button(master, text="V", command=q23, width=1, height=1)
    b23.pack()
Matheus Muller's avatar
Matheus Muller committed
118

119
120
121
    q24 = lambda: atomdef(Cr, Elem, Elembut)
    b24 = tk.Button(master, text="Cr", command=q24, width=1, height=1)
    b24.pack()
Matheus Muller's avatar
Matheus Muller committed
122

123
124
125
    q25 = lambda: atomdef(Mn, Elem, Elembut)
    b25 = tk.Button(master, text="Mn", command=q25, width=1, height=1)
    b25.pack()
Matheus Muller's avatar
Matheus Muller committed
126
 
127
128
129
    q26 = lambda: atomdef(Fe, Elem, Elembut)
    b26 = tk.Button(master, text="Fe", command=q26, width=1, height=1)
    b26.pack()
Matheus Muller's avatar
Matheus Muller committed
130

131
132
133
    q27 = lambda: atomdef(Co, Elem, Elembut)
    b27 = tk.Button(master, text="Co", command=q27, width=1, height=1)
    b27.pack()
Matheus Muller's avatar
Matheus Muller committed
134

135
136
137
    q28 = lambda: atomdef(Ni, Elem, Elembut)
    b28 = tk.Button(master, text="Ni", command=q28, width=1, height=1)
    b28.pack()
Matheus Muller's avatar
Matheus Muller committed
138

139
140
141
    q29 = lambda: atomdef(Cu, Elem, Elembut)
    b29 = tk.Button(master, text="Cu", command=q29, width=1, height=1)
    b29.pack()
Matheus Muller's avatar
Matheus Muller committed
142

143
144
145
    q30 = lambda: atomdef(Zn, Elem, Elembut)
    b30 = tk.Button(master, text="Zn", command=q30, width=1, height=1)
    b30.pack()
Matheus Muller's avatar
Matheus Muller committed
146

147
148
149
    q31 = lambda: atomdef(Ga, Elem, Elembut)
    b31 = tk.Button(master, text="Ga", command=q31, width=1, height=1, bg='purple')
    b31.pack()
Matheus Muller's avatar
Matheus Muller committed
150

151
152
153
    q32 = lambda: atomdef(Ge, Elem, Elembut)
    b32 = tk.Button(master, text="Ge", command=q32, width=1, height=1, bg='blue')
    b32.pack()
Matheus Muller's avatar
Matheus Muller committed
154

155
156
157
    q33 = lambda: atomdef(As, Elem, Elembut)
    b33 = tk.Button(master, text="As", command=q33, width=1, height=1, bg='blue')
    b33.pack()
Matheus Muller's avatar
Matheus Muller committed
158

159
160
161
    q34 = lambda: atomdef(Se, Elem, Elembut)
    b34 = tk.Button(master, text="Se", command=q34, width=1, height=1, bg='green')
    b34.pack()
Matheus Muller's avatar
Matheus Muller committed
162

163
164
165
    q35 = lambda: atomdef(Br, Elem, Elembut)
    b35 = tk.Button(master, text="Br", command=q35, width=1, height=1, bg='red')
    b35.pack()
Matheus Muller's avatar
Matheus Muller committed
166

167
168
169
    q36 = lambda: atomdef(Kr, Elem, Elembut)
    b36 = tk.Button(master, text="Kr", command=q36, width=1, height=1, bg='pink')
    b36.pack()
Matheus Muller's avatar
Matheus Muller committed
170

171
172
173
    q37 = lambda: atomdef(Rb, Elem, Elembut)
    b37 = tk.Button(master, text="Rb", command=q37, width=1, height=1, bg='yellow')
    b37.pack()
Matheus Muller's avatar
Matheus Muller committed
174

175
176
177
    q38 = lambda: atomdef(Sr, Elem, Elembut)
    b38 = tk.Button(master, text="Sr", command=q38, width=1, height=1, bg='brown')
    b38.pack()
Matheus Muller's avatar
Matheus Muller committed
178
 
179
180
181
    q39 = lambda: atomdef(Y, Elem, Elembut)
    b39 = tk.Button(master, text="Y", command=q39, width=1, height=1)
    b39.pack()
Matheus Muller's avatar
Matheus Muller committed
182

183
184
185
    q40 = lambda: atomdef(Zr, Elem, Elembut)
    b40 = tk.Button(master, text="Zr", command=q40, width=1, height=1)
    b40.pack()
Matheus Muller's avatar
Matheus Muller committed
186

187
188
189
    q41 = lambda: atomdef(Nb, Elem, Elembut)
    b41 = tk.Button(master, text="Nb", command=q41, width=1, height=1)
    b41.pack()
Matheus Muller's avatar
Matheus Muller committed
190

191
192
193
    q42 = lambda: atomdef(Mo, Elem, Elembut)
    b42 = tk.Button(master, text="Mo", command=q42, width=1, height=1)
    b42.pack()
Matheus Muller's avatar
Matheus Muller committed
194

195
196
197
    q43 = lambda: atomdef(Tc, Elem, Elembut)
    b43 = tk.Button(master, text="Tc", command=q43, width=1, height=1)
    b43.pack()
Matheus Muller's avatar
Matheus Muller committed
198

199
200
201
    q44 = lambda: atomdef(Ru, Elem, Elembut)
    b44 = tk.Button(master, text="Ru", command=q44, width=1, height=1)
    b44.pack()
Matheus Muller's avatar
Matheus Muller committed
202

203
204
205
    q45 = lambda: atomdef(Rh, Elem, Elembut)
    b45 = tk.Button(master, text="Rh", command=q45, width=1, height=1)
    b45.pack()
Matheus Muller's avatar
Matheus Muller committed
206

207
208
209
    q46 = lambda: atomdef(Pd, Elem, Elembut)
    b46 = tk.Button(master, text="Pd", command=q46, width=1, height=1)
    b46.pack()
Matheus Muller's avatar
Matheus Muller committed
210

211
212
213
    q47 = lambda: atomdef(Ag, Elem, Elembut)
    b47 = tk.Button(master, text="Ag", command=q47, width=1, height=1)
    b47.pack()
Matheus Muller's avatar
Matheus Muller committed
214

215
216
217
    q48 = lambda: atomdef(Cd, Elem, Elembut)
    b48 = tk.Button(master, text="Cd", command=q48, width=1, height=1)
    b48.pack()
Matheus Muller's avatar
Matheus Muller committed
218
 
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
    q49 = lambda: atomdef(In, Elem, Elembut)
    b49 = tk.Button(master, text="In", command=q49, width=1, height=1, bg='purple')
    b49.pack()

    q50 = lambda: atomdef(Sn, Elem, Elembut)
    b50 = tk.Button(master, text="Sn", command=q50, width=1, height=1, bg='purple')    
    b50.pack()    
    
    q51 = lambda: atomdef(Sb, Elem, Elembut)
    b51 = tk.Button(master, text="Sb", command=q51, width=1, height=1, bg='blue')
    b51.pack()

    q52 = lambda: atomdef(Te, Elem, Elembut)
    b52 = tk.Button(master, text="Te", command=q52, width=1, height=1, bg='blue')
    b52.pack()

    q53 = lambda: atomdef(I, Elem, Elembut)
    b53 = tk.Button(master, text="I", command=q53, width=1, height=1, bg='red')
    b53.pack()

    q54 = lambda: atomdef(Xe, Elem, Elembut)
    b54 = tk.Button(master, text="Xe", command=q54, width=1, height=1, bg='pink')
    b54.pack()

    q55 = lambda: atomdef(Cs, Elem, Elembut)
    b55 = tk.Button(master, text="Cs", command=q55, width=1, height=1, bg='yellow')
    b55.pack()

    q56 = lambda: atomdef(Ba, Elem, Elembut)
    b56 = tk.Button(master, text="Ba", command=q56, width=1, height=1, bg='brown')
    b56.pack()

    ####################################################
    
    b1.grid(row=0, column=0, padx=1, pady=1)
    b2.grid(row=0, column=17, padx=1, pady=1)
    b3.grid(row=1, column=0, padx=1, pady=1)
    b4.grid(row=1, column=1, padx=1, pady=1)
    b5.grid(row=1, column=12, padx=1, pady=1)
    b6.grid(row=1, column=13, padx=1, pady=1)
    b7.grid(row=1, column=14, padx=1, pady=1)
    b8.grid(row=1, column=15, padx=1, pady=1)
    b9.grid(row=1, column=16, padx=1, pady=1)
    b10.grid(row=1, column=17, padx=1, pady=1)
    b11.grid(row=2, column=0, padx=1, pady=1)
    b12.grid(row=2, column=1, padx=1, pady=1)
    b13.grid(row=2, column=12, padx=1, pady=1)
    b14.grid(row=2, column=13, padx=1, pady=1)
    b15.grid(row=2, column=14, padx=1, pady=1)
    b16.grid(row=2, column=15, padx=1, pady=1)
    b17.grid(row=2, column=16, padx=1, pady=1)
    b18.grid(row=2, column=17, padx=1, pady=1)
    b19.grid(row=3, column=0, padx=1, pady=1)
    b20.grid(row=3, column=1, padx=1, pady=1)
    b21.grid(row=3, column=2, padx=1, pady=1)
    b22.grid(row=3, column=3, padx=1, pady=1)
    b23.grid(row=3, column=4, padx=1, pady=1)
    b24.grid(row=3, column=5, padx=1, pady=1)
    b25.grid(row=3, column=6, padx=1, pady=1)
    b26.grid(row=3, column=7, padx=1, pady=1)
    b27.grid(row=3, column=8, padx=1, pady=1)
    b28.grid(row=3, column=9, padx=1, pady=1)
    b29.grid(row=3, column=10, padx=1, pady=1)
    b30.grid(row=3, column=11, padx=1, pady=1)
    b31.grid(row=3, column=12, padx=1, pady=1)
    b32.grid(row=3, column=13, padx=1, pady=1)
    b33.grid(row=3, column=14, padx=1, pady=1)
    b34.grid(row=3, column=15, padx=1, pady=1)
    b35.grid(row=3, column=16, padx=1, pady=1)
    b36.grid(row=3, column=17, padx=1, pady=1)
    b37.grid(row=4, column=0, padx=1, pady=1)
    b38.grid(row=4, column=1, padx=1, pady=1)
    b39.grid(row=4, column=2, padx=1, pady=1)
    b40.grid(row=4, column=3, padx=1, pady=1)
    b41.grid(row=4, column=4, padx=1, pady=1)
    b42.grid(row=4, column=5, padx=1, pady=1)
    b43.grid(row=4, column=6, padx=1, pady=1)
    b44.grid(row=4, column=7, padx=1, pady=1)
    b45.grid(row=4, column=8, padx=1, pady=1)
    b46.grid(row=4, column=9, padx=1, pady=1)
    b47.grid(row=4, column=10, padx=1, pady=1)
    b48.grid(row=4, column=11, padx=1, pady=1)
    b49.grid(row=4, column=12, padx=1, pady=1)
    b50.grid(row=4, column=13, padx=1, pady=1)
    b51.grid(row=4, column=14, padx=1, pady=1)
    b52.grid(row=4, column=15, padx=1, pady=1)
    b53.grid(row=4, column=16, padx=1, pady=1)
    b54.grid(row=4, column=17, padx=1, pady=1)
    b55.grid(row=5, column=0, padx=1, pady=1)
    b56.grid(row=5, column=1, padx=1, pady=1)
    
    ####################################################
Matheus Muller's avatar
Matheus Muller committed
311
 
312
    master.mainloop()