-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSerialExaminer.py
664 lines (646 loc) · 21.9 KB
/
SerialExaminer.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
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
# -*- coding: utf-8 -*-
# SerialExaminer.py
# by Pixel
# Repository: https://github.com/Pixel48/SerialExaminer.git
from tkinter import *
from tkinter import filedialog
from functools import partial
import tkinter.font as tkFont
import os, pickle
import openpyxl
versionTag = '0.5.0'
# SOME GLOBALS
R = 0
C = 0
INPUT_FILES = []
OUTPUT_FILE = None
KEY_FILE = None
KEY_DICT = {}
RESULT_DICT = {}
questionCount = 0
answersCount = 0
def newRow(col = 0, row = 1):
global C, R
R += row
C = 0
C += col
def newCol(col = 1):
global C
C += col
def zeroCol(col = 0):
global C, R
R = 0
C = col
def splitLine(line):
if line.split('.')[0].isdigit():
line = line.split('.')
line[0] = int(line[0])
if line[1]:
line[1] = line[1].strip('\n')
line[1] = line[1].strip(' ')[:1].upper()
return line
else:
return [line[0], '#']
else:
return [0, '#']
class MainWindow(object):
"""Creator for main apilcation window"""
def __init__(self, master):
self.master = master
self.master.resizable(width=False, height=False) # lock window resize
self.master.iconbitmap(r'./ico.ico') # icon
self.frame = Frame(self.master)
self.build(self.frame)
self.frame.grid()
def build(self, frame):
zeroCol()
# signature stuff #
self.signatureFont = tkFont.Font(size = 7)
self.gh = Label(frame, font = self.signatureFont)
self.gh['text'] = "GitHub.com/Pixel48/SerialExaminer"
self.gh['fg'] = 'grey'
self.gh.grid(row = 99, column = 0, columnspan = 3, sticky = 'e')
# version #
global versionTag
self.version = Label(frame, font = self.signatureFont)
self.version['text'] = versionTag
self.version.grid(row = 99, column = 0, sticky = 'w')
# main #
# label
self.mainFont = tkFont.Font(size=20)
self.mainLabel = Label(frame, font = self.mainFont)
self.mainLabel['text'] = "SerialExaminer"
self.mainFont['size'] = 15
self.mainLabel.grid(row = R, column = C, columnspan = 3)
# exam key files #
# label
newRow()
self.keyLabel = Label(frame)
self.keyLabel['text'] = "Exam key file"
self.keyLabel.grid(row = R, column = C)
# create button
newCol()
self.keyButtonCreate = Button(frame)
self.keyButtonCreate['text'] = "Create"
self.keyButtonCreate['command'] = self.createKey
self.keyButtonCreate.grid(row = R, column = C)
# import button
newCol()
self.keyButtonImport = Button(frame)
self.keyButtonImport['text'] = "Import"
self.keyButtonImport['command'] = self.importKey
self.keyButtonImport.grid(row = R, column = C)
# input files #
# label
newRow()
self.inputLabel = Label(frame)
self.inputLabel['text'] = "Testing files directory"
self.inputLabel.grid(row = R, column = C, columnspan = 1)
# button
newCol()
self.inputButton = Button(frame)
self.inputButton['text'] = "Browse"
self.inputButton['command'] = self.browseExams
self.inputButton['state'] = DISABLED
self.inputButton.grid(row = R, column = C, columnspan = 2, sticky = 'we')
# serial examinition #
# button
newRow()
self.examinateButtonFont = tkFont.Font(size=15)
self.examinateButton = Button(frame, font = self.examinateButtonFont)
self.examinateButton['text'] = "Check"
self.examinateButton['command'] = self.examinate
self.examinateButton['state'] = DISABLED
self.examinateButton.grid(row = R, column = C, columnspan = 3, sticky = 'we')
# output files #
# label
newRow()
self.outputLabel = Label(frame)
self.outputLabel['text'] = "Retsults"
self.outputLabel.grid(row = R, column = C)
# button display
newCol()
self.outputButtonDsiplay = Button(frame)
self.outputButtonDsiplay['text'] = "Display"
self.outputButtonDsiplay['command'] = self.resultDisplay
self.outputButtonDsiplay['state'] = DISABLED
self.outputButtonDsiplay.grid(row = R, column = C)
# button export
newCol()
self.outputButtonExport = Button(frame)
self.outputButtonExport['text'] = "Export"
self.outputButtonExport['command'] = self.resultExport
self.outputButtonExport['state'] = DISABLED
self.outputButtonExport.grid(row = R, column = C)
def createKey(self):
self.masterWindowCreateKey = Toplevel(self.master)
self.appWindowCreateKey = KeyCreatorWindow(self.masterWindowCreateKey, self)
def importKey(self):
global KEY_FILE
self.keyButtonImport['state'] = DISABLED
self.keyButtonCreate['state'] = DISABLED
KEY_FILE = filedialog.askopenfilename(
title = "Select exam key file",
initialdir = './keys',
filetypes =(
("Exam key file", "*.exkey"),
("Plain text", "*.txt"),
)
)
self.keyButtonImport['state'] = NORMAL
self.keyButtonCreate['state'] = NORMAL
if '.exkey' in KEY_FILE or '.txt' in KEY_FILE:
global questionCount, KEY_DICT
if '.exkey' in KEY_FILE:
with open(KEY_FILE, 'rb') as keyf:
KEY_DICT = pickle.load(keyf)
elif '.txt' in KEY_FILE:
with open(KEY_FILE, 'r') as keyf:
for line in keyf:
line = splitLine(line)
KEY_DICT[line[0]] = line[1]
if 0 in KEY_DICT.keys():
KEY_DICT.pop(0)
questionCount = len(KEY_DICT.keys())
self.inputButton['state'] = NORMAL
def browseExams(self):
global INPUT_FILES
testDir = filedialog.askdirectory(
title = "Examination txt files location",
initialdir = '.',
)
testFiles = os.listdir(testDir)
buffer = []
for file in testFiles:
buffer.append(os.path.join(testDir, file))
for file in buffer:
if '.txt' in file:
INPUT_FILES.append(file)
if INPUT_FILES:
self.examinateButton['state'] = NORMAL
def examinate(self):
global questionCount
for testFile in INPUT_FILES:
with open(testFile, 'r') as examinateFile:
answersDict = {}
points = 0
for line in examinateFile:
line = splitLine(line)
answersDict[line[0]] = line[1]
for question in answersDict.keys():
if question in KEY_DICT.keys():
if answersDict[question] == KEY_DICT[question]:
points += 1
resultName = os.path.basename(testFile).split('.')[0]
RESULT_DICT[resultName] = [str(points) + '/' + str(questionCount), str(round(points*100/questionCount, 2)) + '%']
# NOTE: Result format: {<Filename>: ['<points>/<maxPoints', '<goodAnswersIn%>%']}
self.outputButtonExport['state'] = NORMAL
self.outputButtonDsiplay['state'] = NORMAL
def resultDisplay(self):
self.masterResultDisplayWindow = Toplevel(self.master)
self.appResultDisplayWindow = ResultDisplayWindow(self.masterResultDisplayWindow, self)
def resultExport(self):
# NOTE: RESULT_DICT format: {<Filename>: ['<points>/<maxPoints', '<goodAnswersIn%>%']}
global RESULT_DICT
EXPORT_FILE = filedialog.asksaveasfilename(
title = "Save test result",
initialdir = '.',
initialfile = 'test',
defaultextension = '.xlsx',
filetypes =(
("Excel Spreadsheet ", '*.xlsx'),
("CSV file", "*.csv"),
("Plain text", "*.txt"),
)
)
if EXPORT_FILE[-4:] == '.csv':
with open(EXPORT_FILE, 'w') as export:
export.write(';FILENAME;'+'POINTS (max '+len(RESULT_DICT.keys())+');RESULT IN %\n')
i = 1
for key in RESULT_DICT:
export.write(str(i)+';'+key+';'+RESULT_DICT[key][0].split('/')[0]+';'+RESULT_DICT[key][1][:-1].replace('.',',')+'\n')
i += 1
export.close()
elif EXPORT_FILE[-4:] == '.txt':
with open(EXPORT_FILE, 'w') as export:
i = 1
space = ' '
for key in RESULT_DICT:
export.write(str(i)+'.'+space+key+' --- '+RESULT_DICT[key][0]+' --- '+RESULT_DICT[key][1]+'\n')
i += 1
if i > 9:
space = ' '
export.close()
elif EXPORT_FILE[-5:] == '.xlsx':
wb = openpyxl.Workbook()
sh = wb.create_sheet(index=0)
sh['B1'] = "FILENAME"
sh['C1'] = "POINTS"
sh['D1'] = "RESULT (in %)"
sh['E1'] = "MAX POINTS"
sh['E2'] = len(KEY_DICT.keys())
sh.column_dimensions['B'].width = 25
sh.column_dimensions['C'].width = 8
sh.column_dimensions['D'].width = 13
sh.column_dimensions['E'].width = 12
row = 2
col = 'ABCD'
for key in RESULT_DICT:
sh[str(col[0])+str(row)] = row - 1
sh[str(col[1])+str(row)] = key
sh[str(col[2])+str(row)] = int(RESULT_DICT[key][0].split('/')[0])
sh[str(col[3])+str(row)] = '=ROUND('+str(col[2])+str(row)+'*100/E2, 2)'
row += 1
wb.save(EXPORT_FILE)
class KeyCreatorWindow(object):
"""Creator for CreateKey Window"""
def __init__(self, master, above):
global questionCount, answersCount
questionCount = 40
answersCount = 4
self.master = master
self.master.resizable(width=False, height=False) # lock window resize
self.master.iconbitmap(r'./ico.ico') # icon
self.above = above
self.frame = Frame(self.master)
self.build(self.frame)
self.frame.grid()
def build(self, frame):
zeroCol()
# window name #
# label
self.mainFont = tkFont.Font(size = 14)
self.mainLabel = Label(frame, font = self.mainFont)
self.mainLabel['text'] = "Serial Examiner\nKey Creator"
self.mainLabel.grid(row = R, column = C, columnspan = 7)
# question quantity #
# label
newRow()
self.questionLabel = Label(frame)
self.questionLabel['text'] = "Question quantity"
self.questionLabel.grid(row = R, column = C)
# questions button -10
newCol()
self.questionButtonMinus10 = Button(frame)
self.questionButtonMinus10['text'] = "<<"
self.questionButtonMinus10['width'] = 3
self.questionButtonMinus10['command'] = self.questionCountMinus10
self.questionButtonMinus10.grid(row = R, column = C)
# questions button -1
newCol()
self.questionButtonMinus1 = Button(frame)
self.questionButtonMinus1['text'] = "<"
self.questionButtonMinus1['width'] = 3
self.questionButtonMinus1['command'] = self.questionCountMinus1
self.questionButtonMinus1.grid(row = R, column = C)
# questionsCountLabel
newCol()
self.questionLabelCount = Label(frame)
self.questionLabelCount['text'] = questionCount
self.questionLabelCount['width'] = 3
self.questionLabelCount.grid(row = R, column = C)
# questions button +1
newCol()
self.questionButtonPlus1 = Button(frame)
self.questionButtonPlus1['text'] = ">"
self.questionButtonPlus1['width'] = 3
self.questionButtonPlus1['command'] = self.questionCountPlus1
self.questionButtonPlus1.grid(row = R, column = C)
# questions button +10
newCol()
self.questionButtonPlus10 = Button(frame)
self.questionButtonPlus10['text'] = ">>"
self.questionButtonPlus10['width'] = 3
self.questionButtonPlus10['command'] = self.questionCountPlus10
self.questionButtonPlus10.grid(row = R, column = C)
# button 0
newCol()
self.questionButton0 = Button(frame)
self.questionButton0['text'] = "|<-"
self.questionButton0['width'] = 3
self.questionButton0['command'] = self.question0
self.questionButton0.grid(row = R, column = C)
# answers quantity #
# label
newRow()
self.answerLabel = Label(frame)
self.answerLabel['text'] = "Answers quantinity"
self.answerLabel.grid(row = R, column = C)
# answers button -10
newCol()
self.answerButtonMinus4 = Button(frame)
self.answerButtonMinus4['text'] = "<<"
self.answerButtonMinus4['width'] = 3
self.answerButtonMinus4['command'] = self.answerCountMinus4
self.answerButtonMinus4.grid(row = R, column = C)
# answers button -1
newCol()
self.answerButtonMinus1 = Button(frame)
self.answerButtonMinus1['text'] = "<"
self.answerButtonMinus1['width'] = 3
self.answerButtonMinus1['command'] = self.answerCountMinus1
self.answerButtonMinus1.grid(row = R, column = C)
# answersCountLabel
newCol()
self.answerLabelCount = Label(frame)
self.answerLabelCount['text'] = answersCount
self.answerLabelCount['width'] = 3
self.answerLabelCount.grid(row = R, column = C)
# answers button +1
newCol()
self.answerButtonPlus1 = Button(frame)
self.answerButtonPlus1['text'] = ">"
self.answerButtonPlus1['width'] = 3
self.answerButtonPlus1['command'] = self.answerCountPlus1
self.answerButtonPlus1.grid(row = R, column = C)
# answers button +10
newCol()
self.answerButtonPlus4 = Button(frame)
self.answerButtonPlus4['text'] = ">>"
self.answerButtonPlus4['width'] = 3
self.answerButtonPlus4['command'] = self.answerCountPlus4
self.answerButtonPlus4.grid(row = R, column = C)
# Main buttons #
newRow()
self.nextWindowFont = tkFont.Font(size = 14)
self.nextWindow = Button(frame, font = self.nextWindowFont)
self.nextWindow['text'] = "Create Key"
self.nextWindow['command'] = self.mainKeyCreator
self.nextWindow.grid(row = R, column = C, columnspan = 7, sticky = 'we')
# key config done button #
newRow()
self.keyDone = Button(frame, font = self.nextWindowFont)
self.keyDone['text'] = "Done"
self.keyDone['command'] = self.die
self.keyDone['state'] = DISABLED
self.keyDone.grid(row = R, column = C, columnspan = 7, sticky = 'we')
def question0(self):
global questionCount
questionCount = 40
self.questionLabelCount['text'] = questionCount
def questionCountMinus10(self):
global questionCount
questionCount -= 10
if questionCount < 1:
questionCount = 1
self.questionLabelCount['text'] = questionCount
def questionCountMinus1(self):
global questionCount
questionCount -= 1
if questionCount < 1:
questionCount = 1
self.questionLabelCount['text'] = questionCount
def questionCountPlus1(self):
global questionCount
questionCount += 1
self.questionLabelCount['text'] = questionCount
def questionCountPlus10(self):
global questionCount
questionCount += 10
self.questionLabelCount['text'] = questionCount
def answerCountMinus4(self):
global answersCount
answersCount -= 4
if answersCount < 4:
answersCount = 12
self.answerLabelCount['text'] = answersCount
def answerCountMinus1(self):
global answersCount
answersCount -= 1
if answersCount < 4:
answersCount = 12
self.answerLabelCount['text'] = answersCount
def answerCountPlus1(self):
global answersCount
answersCount += 1
if answersCount > 12:
answersCount = 4
self.answerLabelCount['text'] = answersCount
def answerCountPlus4(self):
global answersCount
answersCount += 4
if answersCount > 12:
answersCount = 4
self.answerLabelCount['text'] = answersCount
def mainKeyCreator(self):
self.masterMainWindowCreateKey = Toplevel(self.master)
self.appWindowCreateKey = MainKeyCreatorWindow(self.masterMainWindowCreateKey, self)
def exportKeyFile(self, file):
with open(file, 'wb') as keyFile:
pickle.dump(KEY_DICT, keyFile)
def die(self):
global KEY_FILE
KEY_FILE = filedialog.asksaveasfilename(
title = "Select exam key file",
initialdir = './keys',
initialfile = 'key',
defaultextension = '.exkey',
filetypes =(
("Exam Key File", "*.exkey"),
)
)
if KEY_FILE != '': # if no filename provided, don't proceed
self.exportKeyFile(KEY_FILE)
self.above.inputButton['state'] = NORMAL
self.master.destroy()
class MainKeyCreatorWindow(object):
"""Window to create exam key"""
def __init__(self, master, above):
global KEY_DICT
KEY_DICT = {}
self.master = master
self.master.resizable(width=False, height=False) # lock window resize
self.master.iconbitmap(r'./ico.ico') # icon
self.above = above
self.frame = Frame(self.master)
self.questionNo = 1
self.build(self.frame)
self.frame.grid()
def build(self, frame):
zeroCol()
# main label #
# label/counter
self.mainFont = tkFont.Font(size = 14)
self.mainLabel = Label(frame, font = self.mainFont)
self.mainLabel['width'] = 20
self.mainLabelUpdate()
self.mainLabel.grid(row = R, column = C, columnspan = 5, sticky = 'we')
# question/answer buttons #
# back button
newRow()
self.backButton = Button(frame)
# self.backButton['width'] = 3
self.backButton['text'] = "<"
self.backButton['command'] = self.backQuestion
rs = 1
if answersCount > 4:
rs += 1
if answersCount > 8:
rs += 1
self.backButton.grid(row = R, column = C, rowspan = rs, sticky = 'nesw')
newCol()
self.aButton = Button(frame)
self.aButton['text'] = "A"
self.aButton['command'] = partial(self.bindAnswer, "A")
self.aButton.grid(row = R, column = C, sticky = 'we')
newCol()
self.bButton = Button(frame)
self.bButton['text'] = "B"
self.bButton['command'] = partial(self.bindAnswer, "B")
self.bButton.grid(row = R, column = C, sticky = 'we')
newCol()
self.cButton = Button(frame)
self.cButton['text'] = "C"
self.cButton['command'] = partial(self.bindAnswer, "C")
self.cButton.grid(row = R, column = C, sticky = 'we')
newCol()
self.dButton = Button(frame)
self.dButton['text'] = "D"
self.dButton['command'] = partial(self.bindAnswer, "D")
self.dButton.grid(row = R, column = C, sticky = 'we')
if answersCount > 4:
newRow()
if answersCount > 4:
newCol()
self.eButton = Button(frame)
self.eButton['text'] = "E"
self.eButton['command'] = partial(self.bindAnswer, "E")
self.eButton.grid(row = R, column = C, sticky = 'we')
if answersCount > 5:
newCol()
self.fButton = Button(frame)
self.fButton['text'] = "F"
self.fButton['command'] = partial(self.bindAnswer, "F")
self.fButton.grid(row = R, column = C, sticky = 'we')
if answersCount > 6:
newCol()
self.gButton = Button(frame)
self.gButton['text'] = "G"
self.gButton['command'] = partial(self.bindAnswer, "G")
self.gButton.grid(row = R, column = C, sticky = 'we')
if answersCount > 7:
newCol()
self.hButton = Button(frame)
self.hButton['text'] = "H"
self.hButton['command'] = partial(self.bindAnswer, "H")
self.hButton.grid(row = R, column = C, sticky = 'we')
if answersCount > 8:
newRow()
if answersCount > 8:
newCol()
self.iButton = Button(frame)
self.iButton['text'] = "I"
self.iButton['command'] = partial(self.bindAnswer, "I")
self.iButton.grid(row = R, column = C, sticky = 'we')
if answersCount > 9:
newCol()
self.jButton = Button(frame)
self.jButton['text'] = "J"
self.jButton['command'] = partial(self.bindAnswer, "J")
self.jButton.grid(row = R, column = C, sticky = 'we')
if answersCount > 10:
newCol()
self.kButton = Button(frame)
self.kButton['text'] = "K"
self.kButton['command'] = partial(self.bindAnswer, "K")
self.kButton.grid(row = R, column = C, sticky = 'we')
if answersCount > 11:
newCol()
self.lButton = Button(frame)
self.lButton['text'] = "L"
self.lButton['command'] = partial(self.bindAnswer, "L")
self.lButton.grid(row = R, column = C, sticky = 'we')
def backQuestion(self):
self.questionNo -= 1
if self.questionNo < 1:
self.questionNo = 1
self.mainLabelUpdate()
def bindAnswer(self, questionAnswer):
global KEY_DICT
KEY_DICT[self.questionNo] = questionAnswer
self.questionNo += 1
self.mainLabelUpdate()
def mainLabelUpdate(self):
self.mainLabel['text'] = "Question " + str(self.questionNo)
if self.questionNo > questionCount:
self.above.keyDone['state'] = NORMAL
self.above.nextWindow['text'] = "ReCreate Key"
self.die()
def die(self):
self.master.destroy()
class ResultDisplayWindow(object):
"""Pop-up with test results from RESULT_DICT"""
def __init__(self, master, above):
self.master = master
self.master.resizable(width=False, height=False) # lock window resize
self.master.iconbitmap(r'./ico.ico') # icon
self.above = above
self.frame = Frame(self.master)
self.build(self.frame)
self.frame.grid()
def build(self, frame):
global RESULT_DICT
x = 0
zeroCol()
# legend #
newCol()
Label(frame,
text = "Name",
fg = 'blue',
width = 15).grid(row = R, column = C)
newCol()
Label(frame,
text = "Points",
fg = 'blue',
width = 10).grid(row = R, column = C)
newCol()
Label(frame,
text = "Result",
fg = 'red').grid(row = R, column = C)
# results #
limit = 45
endLimit = 270
x = 0
for filename in list(RESULT_DICT.keys())[:endLimit]:
newRow(x//limit*4)
x += 1
xx = str(x)+'.'
if x > limit:
xx = '\t' + xx
Label(frame,
text = xx).grid(row = R, column = C)
newCol()
Label(frame,
text = filename).grid(row = R, column = C, sticky = 'w')
newCol()
Label(frame,
text = RESULT_DICT[filename][0]).grid(row = R, column = C)
newCol()
Label(frame,
text = RESULT_DICT[filename][1]).grid(row = R, column = C)
if x % limit == 0 and x < endLimit:
zeroCol((x//limit)*4)
# legend #
newCol()
Label(frame,
text = "Name",
fg = 'blue',
width = 15).grid(row = R, column = C)
newCol()
Label(frame,
text = "Points",
fg = 'blue',
width = 10).grid(row = R, column = C)
newCol()
Label(frame,
text = "Result",
fg = 'red').grid(row = R, column = C)
def main():
root = Tk()
root.title("SeriEx")
ws = root.winfo_screenwidth()
hs = root.winfo_screenheight()
app = MainWindow(root)
root.mainloop()
if __name__ == '__main__':
main()