-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathenigma_run_with_gui.py
357 lines (260 loc) · 18.4 KB
/
enigma_run_with_gui.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
'''
Autor ==> Mohammad Hasan Anisi
github page ==> https://github.com/mohammadhasananisi
telegram ==> https://t.me/mohammadhasananisi
Linkedin https://linkedin.com/in/mohammadhasan-anisi-159757202
'''
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.font as tkFont
from enigma_machine import Enigma
class App(tk.Frame):
def __init__(self, master):
super().__init__(master)
master.resizable(width=False, height=False)
self.font = tkFont.Font(family='Times',size=13)
self.widgets(master)
def widgets_plugboard(self, app):
### Plugboard Started
self.plugboard_lable =tk.Label(text="Plugboard: ", font =self.font)
self.plugboard_lable.pack()
self.plugboard_lable.place(x=1,y=550,width=80,height=30)
self.choiceVar_plugboard_1_1 = tk.StringVar()
self.plugboard_list_1_1 = ttk.Combobox(textvariable=self.choiceVar_plugboard_1_1)
self.plugboard_list_1_1.pack()
self.plugboard_list_1_1['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_1_1.current(0)
self.plugboard_list_1_1.place(x=80,y=550,width=40,height=25)
self.choiceVar_plugboard_1_2 = tk.StringVar()
self.plugboard_list_1_2 = ttk.Combobox(textvariable=self.choiceVar_plugboard_1_2)
self.plugboard_list_1_2.pack()
self.plugboard_list_1_2['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_1_2.current(19)
self.plugboard_list_1_2.place(x=120,y=550,width=40,height=25)
self.choiceVar_plugboard_2_1 = tk.StringVar()
self.plugboard_list_2_1 = ttk.Combobox(textvariable=self.choiceVar_plugboard_2_1)
self.plugboard_list_2_1.pack()
self.plugboard_list_2_1['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_2_1.current(1)
self.plugboard_list_2_1.place(x=200,y=550,width=40,height=25)
self.choiceVar_plugboard_2_2 = tk.StringVar()
self.plugboard_list_2_2 = ttk.Combobox(textvariable=self.choiceVar_plugboard_2_2)
self.plugboard_list_2_2.pack()
self.plugboard_list_2_2['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_2_2.current(18)
self.plugboard_list_2_2.place(x=240,y=550,width=40,height=25)
self.choiceVar_plugboard_3_1 = tk.StringVar()
self.plugboard_list_3_1 = ttk.Combobox(textvariable=self.choiceVar_plugboard_3_1)
self.plugboard_list_3_1.pack()
self.plugboard_list_3_1['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_3_1.current(3)
self.plugboard_list_3_1.place(x=320,y=550,width=40,height=25)
self.choiceVar_plugboard_3_2 = tk.StringVar()
self.plugboard_list_3_2 = ttk.Combobox(textvariable=self.choiceVar_plugboard_3_2)
self.plugboard_list_3_2.pack()
self.plugboard_list_3_2['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_3_2.current(4)
self.plugboard_list_3_2.place(x=360,y=550,width=40,height=25)
self.choiceVar_plugboard_4_1 = tk.StringVar()
self.plugboard_list_4_1 = ttk.Combobox(textvariable=self.choiceVar_plugboard_4_1)
self.plugboard_list_4_1.pack()
self.plugboard_list_4_1['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_4_1.current(5)
self.plugboard_list_4_1.place(x=440,y=550,width=40,height=25)
self.choiceVar_plugboard_4_2 = tk.StringVar()
self.plugboard_list_4_2 = ttk.Combobox(textvariable=self.choiceVar_plugboard_4_2)
self.plugboard_list_4_2.pack()
self.plugboard_list_4_2['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_4_2.current(12)
self.plugboard_list_4_2.place(x=480,y=550,width=40,height=25)
self.choiceVar_plugboard_5_1 = tk.StringVar()
self.plugboard_list_5_1 = ttk.Combobox(textvariable=self.choiceVar_plugboard_5_1)
self.plugboard_list_5_1.pack()
self.plugboard_list_5_1['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_5_1.current(8)
self.plugboard_list_5_1.place(x=560,y=550,width=40,height=25)
self.choiceVar_plugboard_5_2 = tk.StringVar()
self.plugboard_list_5_2 = ttk.Combobox(textvariable=self.choiceVar_plugboard_5_2)
self.plugboard_list_5_2.pack()
self.plugboard_list_5_2['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_5_2.current(17)
self.plugboard_list_5_2.place(x=600,y=550,width=40,height=25)
self.choiceVar_plugboard_6_1 = tk.StringVar()
self.plugboard_list_6_1 = ttk.Combobox(textvariable=self.choiceVar_plugboard_6_1)
self.plugboard_list_6_1.pack()
self.plugboard_list_6_1['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_6_1.current(10)
self.plugboard_list_6_1.place(x=80,y=600,width=40,height=25)
self.choiceVar_plugboard_6_2 = tk.StringVar()
self.plugboard_list_6_2 = ttk.Combobox(textvariable=self.choiceVar_plugboard_6_2)
self.plugboard_list_6_2.pack()
self.plugboard_list_6_2['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_6_2.current(13)
self.plugboard_list_6_2.place(x=120,y=600,width=40,height=25)
self.choiceVar_plugboard_7_1 = tk.StringVar()
self.plugboard_list_7_1 = ttk.Combobox(textvariable=self.choiceVar_plugboard_7_1)
self.plugboard_list_7_1.pack()
self.plugboard_list_7_1['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_7_1.current(11)
self.plugboard_list_7_1.place(x=200,y=600,width=40,height=25)
self.choiceVar_plugboard_7_2 = tk.StringVar()
self.plugboard_list_7_2 = ttk.Combobox(textvariable=self.choiceVar_plugboard_7_2)
self.plugboard_list_7_2.pack()
self.plugboard_list_7_2['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_7_2.current(25)
self.plugboard_list_7_2.place(x=240,y=600,width=40,height=25)
self.choiceVar_plugboard_8_1 = tk.StringVar()
self.plugboard_list_8_1 = ttk.Combobox(textvariable=self.choiceVar_plugboard_8_1)
self.plugboard_list_8_1.pack()
self.plugboard_list_8_1['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_8_1.current(14)
self.plugboard_list_8_1.place(x=320,y=600,width=40,height=25)
self.choiceVar_plugboard_8_2 = tk.StringVar()
self.plugboard_list_8_2 = ttk.Combobox(textvariable=self.choiceVar_plugboard_8_2)
self.plugboard_list_8_2.pack()
self.plugboard_list_8_2['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_8_2.current(22)
self.plugboard_list_8_2.place(x=360,y=600,width=40,height=25)
self.choiceVar_plugboard_9_1 = tk.StringVar()
self.plugboard_list_9_1 = ttk.Combobox(textvariable=self.choiceVar_plugboard_9_1)
self.plugboard_list_9_1.pack()
self.plugboard_list_9_1['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_9_1.current(15)
self.plugboard_list_9_1.place(x=440,y=600,width=40,height=25)
self.choiceVar_plugboard_9_2 = tk.StringVar()
self.plugboard_list_9_2 = ttk.Combobox(textvariable=self.choiceVar_plugboard_9_2)
self.plugboard_list_9_2.pack()
self.plugboard_list_9_2['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_9_2.current(21)
self.plugboard_list_9_2.place(x=480,y=600,width=40,height=25)
self.choiceVar_plugboard_10_1 = tk.StringVar()
self.plugboard_list_10_1 = ttk.Combobox(textvariable=self.choiceVar_plugboard_10_1)
self.plugboard_list_10_1.pack()
self.plugboard_list_10_1['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_10_1.current(23)
self.plugboard_list_10_1.place(x=560,y=600,width=40,height=25)
self.choiceVar_plugboard_10_2 = tk.StringVar()
self.plugboard_list_10_2 = ttk.Combobox(textvariable=self.choiceVar_plugboard_10_2)
self.plugboard_list_10_2.pack()
self.plugboard_list_10_2['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.plugboard_list_10_2.current(24)
self.plugboard_list_10_2.place(x=600,y=600,width=40,height=25)
# End
def widgets(self, app):
self.lable_input = tk.Label(text="Enter Text or Code text", font=('Times', 24))
self.lable_input.pack(padx=20, pady=20)
# self.lable_input.place(x=50, y=330, width=70, height=25)
self.input_code_or_str = tk.Entry(font=('Times', 24), width=40,)
self.input_code_or_str.pack()
self.contents = tk.StringVar()
self.input_code_or_str["textvariable"] = self.contents
self.input_code_or_str.bind('<Key-Return>', self.enigma_con)
self.lable_result = tk.Label(text="", font=("Times", 22), height=5)
self.lable_result.pack()
self.btn_handeler = tk.Button(text="Convert", font=("Times", 20))
self.btn_handeler.pack()
self.btn_handeler.config(command=self.enigma_con)
self.reflector_lable=tk.Label(text="Reflector", justify="center", font =self.font)
self.reflector_lable.pack()
self.reflector_lable.place(x=50,y=330,width=70,height=25)
self.choiceVar_reflector_list = tk.StringVar()
self.reflector_list = ttk.Combobox(textvariable=self.choiceVar_reflector_list)
self.reflector_list.pack()
self.reflector_list['values'] = ("UKW-B", "UKW-C")
self.reflector_list.current(0)
self.reflector_list.place(x=120,y=330,width=80,height=25)
self.rotor_lable =tk.Label(text="Rotor", font =self.font)
self.rotor_lable.pack()
self.rotor_lable.place(x=200,y=360,width=70,height=25)
self.choiceVar_rotor_list_1 = tk.StringVar()
self.rotor_list_1 = ttk.Combobox(textvariable=self.choiceVar_rotor_list_1)
self.rotor_list_1.pack()
self.rotor_list_1['values'] = ('I', 'II', 'III', 'IV', 'V')
self.rotor_list_1.current(0)
self.rotor_list_1.place(x=300,y=360,width=80,height=25)
self.choiceVar_rotor_list_2 = tk.StringVar()
self.rotor_list_2 = ttk.Combobox(textvariable=self.choiceVar_rotor_list_2)
self.rotor_list_2.pack()
self.rotor_list_2['values'] = ('I', 'II', 'III', 'IV', 'V')
self.rotor_list_2.current(1)
self.rotor_list_2.place(x=400,y=360,width=80,height=25)
self.choiceVar_rotor_list_3 = tk.StringVar()
self.rotor_list_3 = ttk.Combobox(textvariable=self.choiceVar_rotor_list_3)
self.rotor_list_3.pack()
self.rotor_list_3['values'] = ('I', 'II', 'III', 'IV', 'V')
self.rotor_list_3.current(2)
self.rotor_list_3.place(x=500,y=360,width=80,height=25)
self.ring_setting_lable =tk.Label(text="Ring Setting", font =self.font)
self.ring_setting_lable.pack()
self.ring_setting_lable.place(x=200,y=410,width=100,height=30)
self.choiceVar_ring_ring_setting_list_1 = tk.StringVar()
self.ring_setting_list_1 = ttk.Combobox(textvariable=self.choiceVar_ring_ring_setting_list_1)
self.ring_setting_list_1.pack()
self.ring_setting_list_1['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.ring_setting_list_1.current(0)
self.ring_setting_list_1.place(x=300,y=420,width=80,height=25)
self.choiceVar_ring_ring_setting_list_2 = tk.StringVar()
self.ring_setting_list_2 = ttk.Combobox(textvariable=self.choiceVar_ring_ring_setting_list_2)
self.ring_setting_list_2.pack()
self.ring_setting_list_2['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.ring_setting_list_2.current(1)
self.ring_setting_list_2.place(x=400,y=420,width=80,height=25)
self.choiceVar_ring_ring_setting_list_3 = tk.StringVar()
self.ring_setting_list_3 = ttk.Combobox(textvariable=self.choiceVar_ring_ring_setting_list_3)
self.ring_setting_list_3.pack()
self.ring_setting_list_3['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.ring_setting_list_3.current(2)
self.ring_setting_list_3.place(x=500,y=420,width=80,height=25)
self.initial_position_lable =tk.Label(text="Initial Position", font =self.font)
self.initial_position_lable.pack()
self.initial_position_lable.place(x=200,y=480,width=100,height=30)
self.choiceVar_initial_position_list_1 = tk.StringVar()
self.initial_position_list_1 = ttk.Combobox(textvariable=self.choiceVar_initial_position_list_1)
self.initial_position_list_1.pack()
self.initial_position_list_1['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.initial_position_list_1.current(3)
self.initial_position_list_1.place(x=300,y=480,width=80,height=25)
self.choiceVar_initial_position_list_2 = tk.StringVar()
self.initial_position_list_2 = ttk.Combobox(textvariable=self.choiceVar_initial_position_list_2)
self.initial_position_list_2.pack()
self.initial_position_list_2['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.initial_position_list_2.current(4)
self.initial_position_list_2.place(x=400,y=480,width=80,height=25)
self.choiceVar_initial_position_list_3 = tk.StringVar()
self.initial_position_list_3 = ttk.Combobox(textvariable=self.choiceVar_initial_position_list_3)
self.initial_position_list_3.pack()
self.initial_position_list_3['values'] = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')
self.initial_position_list_3.current(5)
self.initial_position_list_3.place(x=500,y=480,width=80,height=25)
self.top_Rotor_lable_1=tk.Label(text="1 st Rotor:", font =self.font)
self.top_Rotor_lable_1.pack()
self.top_Rotor_lable_1.place(x=300,y=320,width=91,height=30)
self.top_Rotor_lable_2=tk.Label(text="2 nd Rotor:", font =self.font)
self.top_Rotor_lable_2.pack()
self.top_Rotor_lable_2.place(x=400,y=320,width=88,height=30)
self.top_Rotor_lable_3=tk.Label(text="3 rd Rotor:", font =self.font)
self.top_Rotor_lable_3.pack()
self.top_Rotor_lable_3.place(x=500,y=320,width=91,height=30)
self.widgets_plugboard(app=app)
def enigma_con(self, ev=None):
plugboard = self.choiceVar_plugboard_1_1.get() + self.choiceVar_plugboard_1_2.get() + " "
plugboard += self.choiceVar_plugboard_2_1.get() + self.choiceVar_plugboard_2_2.get() + " "
plugboard += self.choiceVar_plugboard_3_1.get() + self.choiceVar_plugboard_3_2.get() + " "
plugboard += self.choiceVar_plugboard_4_1.get() + self.choiceVar_plugboard_4_2.get() + " "
plugboard += self.choiceVar_plugboard_5_1.get() + self.choiceVar_plugboard_5_2.get() + " "
plugboard += self.choiceVar_plugboard_6_1.get() + self.choiceVar_plugboard_6_2.get() + " "
plugboard += self.choiceVar_plugboard_7_1.get() + self.choiceVar_plugboard_7_2.get() + " "
plugboard += self.choiceVar_plugboard_8_1.get() + self.choiceVar_plugboard_8_2.get() + " "
plugboard += self.choiceVar_plugboard_9_1.get() + self.choiceVar_plugboard_9_2.get() + " "
plugboard += self.choiceVar_plugboard_10_1.get() + self.choiceVar_plugboard_10_2.get()
a = Enigma(
rotors= (self.choiceVar_rotor_list_1.get(), self.choiceVar_rotor_list_2.get(), self.choiceVar_rotor_list_3.get()),
reflector= self.choiceVar_reflector_list.get(),
ringSettings= self.choiceVar_ring_ring_setting_list_1.get() + self.choiceVar_ring_ring_setting_list_2.get() + self.choiceVar_ring_ring_setting_list_3.get(),
ringPositions= self.choiceVar_initial_position_list_1.get() + self.choiceVar_initial_position_list_2.get() + self.choiceVar_initial_position_list_3.get(),
plugboard= plugboard)
self.lable_result.config(text=a.encode(self.contents.get()))
app = tk.Tk(className="Enigma Machine")
app.geometry("750x650")
myapp = App(app)
myapp.mainloop()