-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tkinter_Learning11.py
1801 lines (1533 loc) · 97.6 KB
/
Tkinter_Learning11.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
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import tkinter as tk
from tkinter import ttk # Normal Tkinter.* widgets are not themed!
from ttkthemes import ThemedStyle
from tkinter import messagebox, END, TOP, RIGHT, NW, Y
from tkcalendar import DateEntry
import xlwings as xw
import os
class MenuBar(tk.Menu):
def __init__(self, master):
tk.Menu.__init__(self, master)
self.master = master
# Create a Menu Item for Database
database_menu = tk.Menu(self, tearoff=False)
# Create a Menu Item for Teachers
teachers_menu = tk.Menu(self, tearoff=False)
# Create a Menu Item for Groups
groups_menu = tk.Menu(self, tearoff=False)
# Create a Menu Item for Info --EightSoft dev
info_menu = tk.Menu(self, tearoff=False)
# Add the cascades for menu bar
self.add_cascade(label="Mаълумотлар базаси", menu=database_menu)
self.add_cascade(label="Ўқитувчилар", menu=teachers_menu)
self.add_cascade(label="Гуруҳ", menu=groups_menu)
self.add_cascade(label="Инфо", menu=info_menu)
# Database
database_menu.add_command(label="Барча гуруҳлар рўйхати", command=self.db_groups)
database_menu.add_command(label="Барча ўқувчилар рўйхати", command=self.db_students)
database_menu.add_command(label="Барча ўқитувчилар рўйхати", command=self.db_teachers)
# Teachers
teachers_menu.add_command(label="Қўшиш", command=self.teachers_add)
teachers_menu.add_command(label="Янгилаш", command=self.teachers_edit)
teachers_menu.add_command(label="Ўчириш", command=self.teachers_delete)
# Groups
groups_menu.add_command(label="Қўшиш", command=self.groups_add)
# groups_menu.add_command(label="Янгилаш", command=self.groups_edit)
groups_menu.add_command(label="Ўчириш", command=self.groups_delete)
# Info
info_menu.add_command(label="Илова ҳақида", command=self.info_about)
info_menu.add_separator()
# Create frames for each new window --MenuBar-Cascade-Commands
self.db_groups_frame = ttk.Frame(master)
self.db_students_frame = ttk.Frame(master)
self.db_teachers_frame = ttk.Frame(master)
self.teachers_add_frame = ttk.Frame(master)
self.teachers_edit_frame = ttk.Frame(master)
self.teachers_delete_frame = ttk.Frame(master)
self.groups_add_frame = ttk.Frame(master)
self.groups_edit_frame = ttk.Frame(master)
self.groups_delete_frame = ttk.Frame(master)
self.info_about_frame = ttk.Frame(master)
# Hide the frames when you switch the menu
def hide_all_frames(self):
"""Cleans the screen after pressing the menu item"""
for widget in self.db_groups_frame.winfo_children():
widget.destroy()
for widget in self.db_students_frame.winfo_children():
widget.destroy()
for widget in self.db_teachers_frame.winfo_children():
widget.destroy()
for widget in self.teachers_add_frame.winfo_children():
widget.destroy()
for widget in self.teachers_edit_frame.winfo_children():
widget.destroy()
for widget in self.teachers_delete_frame.winfo_children():
widget.destroy()
for widget in self.groups_add_frame.winfo_children():
widget.destroy()
for widget in self.groups_edit_frame.winfo_children():
widget.destroy()
for widget in self.groups_delete_frame.winfo_children():
widget.destroy()
for widget in self.info_about_frame.winfo_children():
widget.destroy()
self.db_groups_frame.pack_forget()
self.db_students_frame.pack_forget()
self.db_teachers_frame.pack_forget()
self.teachers_add_frame.pack_forget()
self.teachers_edit_frame.pack_forget()
self.teachers_delete_frame.pack_forget()
self.groups_add_frame.pack_forget()
self.groups_edit_frame.pack_forget()
self.groups_delete_frame.pack_forget()
self.info_about_frame.pack_forget()
# Create methods for Teachers
def teachers_add(self):
self.hide_all_frames()
self.teachers_add_frame.pack(fill="both", expand=1)
# Creating a Notebook
teachers_notebook = ttk.Notebook(self.teachers_add_frame)
teachers_notebook.pack(pady=10, padx=10)
# Initialize frames for notebooks
instructors_frame = ttk.Frame(teachers_notebook)
others_frame = ttk.Frame(teachers_notebook)
# Place the frames on the screen
instructors_frame.pack(fill="both", expand=1)
others_frame.pack(fill="both", expand=1)
# Add the notebooks
teachers_notebook.add(instructors_frame, text="Усталap Қўшиш")
teachers_notebook.add(others_frame, text="Ўқитувчилар Қўшиш")
# Create main form to enter teachers - Frontend Part
# "Усталap" - First notebook
first_name_label = ttk.Label(instructors_frame, text="Исм").grid(row=1, column=0, padx=10, pady=5)
middle_name_label = ttk.Label(instructors_frame, text="Фамилия").grid(row=2, column=0, padx=10)
last_name_label = ttk.Label(instructors_frame, text="Отчество").grid(row=3, column=0, padx=10)
license_number_label = ttk.Label(instructors_frame, text="Х/Г №").grid(row=4, column=0, padx=10)
garage_number_label = ttk.Label(instructors_frame, text="Гар. №").grid(row=5, column=0, padx=10)
car_label = ttk.Label(instructors_frame, text="Марка").grid(row=6, column=0, padx=10)
car_number_label = ttk.Label(instructors_frame, text="Гос. №").grid(row=7, column=0, padx=10)
application_label = ttk.Label(instructors_frame, text="Заявка учун маълумотлар: ").grid(row=8, column=0, padx=10, columnspan=2)
education_label = ttk.Label(instructors_frame, text=" Маълумоти ").grid(row=9, column=0)
type_license_label = ttk.Label(instructors_frame, text="Tоифа").grid(row=10, column=0, padx=10)
internship_label = ttk.Label(instructors_frame, text="Стаж").grid(row=11, column=0, padx=10)
# Create Entry Box for the First notebook
first_name_box = ttk.Entry(instructors_frame)
first_name_box.grid(row=1, column=1, pady=3)
middle_name_box = ttk.Entry(instructors_frame)
middle_name_box.grid(row=2, column=1, pady=3)
last_name_box = ttk.Entry(instructors_frame)
last_name_box.grid(row=3, column=1, pady=3)
license_number_box = ttk.Entry(instructors_frame)
license_number_box.grid(row=4, column=1, pady=3)
garage_number_box = ttk.Entry(instructors_frame)
garage_number_box.grid(row=5, column=1, pady=3)
car_box = ttk.Entry(instructors_frame)
car_box.grid(row=6, column=1, pady=3)
car_number_box = ttk.Entry(instructors_frame)
car_number_box.grid(row=7, column=1, pady=3)
education_box = ttk.Entry(instructors_frame)
education_box.grid(row=9, column=1, pady=3)
type_license_box = ttk.Entry(instructors_frame)
type_license_box.grid(row=10, column=1, pady=3)
internship_box = ttk.Entry(instructors_frame)
internship_box.grid(row=11, column=1, pady=3)
# "Ўқитувчилар" - Second notebook
OptionList_1 = ["Авто.туз & ЙХК", "Тиббий ёрдам"]
variable_1 = tk.StringVar(others_frame)
variable_1.set(OptionList_1[0])
opt_1 = ttk.OptionMenu(others_frame, variable_1, OptionList_1[0], *OptionList_1)
opt_1.config(width=24)
opt_1.grid(row=0, column=0, pady=5, columnspan=2)
t_first_name_label = ttk.Label(others_frame, text="Исм").grid(row=1, column=0, padx=10)
t_middle_name_label = ttk.Label(others_frame, text="Фамилия").grid(row=2, column=0, padx=10)
t_last_name_label = ttk.Label(others_frame, text="Отчество").grid(row=3, column=0, padx=10)
t_education_label = ttk.Label(others_frame, text="Маълумоти").grid(row=4, column=0, padx=10)
t_specialization_label = ttk.Label(others_frame, text="Мутахасислиги").grid(row=5, column=0, padx=10)
# Create Entry Box for the Second notebook
t_first_name_box = ttk.Entry(others_frame)
t_first_name_box.grid(row=1, column=1, pady=3, padx=10)
t_middle_name_box = ttk.Entry(others_frame)
t_middle_name_box.grid(row=2, column=1, pady=3)
t_last_name_box = ttk.Entry(others_frame)
t_last_name_box.grid(row=3, column=1, pady=3)
t_education_box = ttk.Entry(others_frame)
t_education_box.grid(row=4, column=1, pady=3)
t_specialization_box = ttk.Entry(others_frame)
t_specialization_box.grid(row=5, column=1, pady=3)
# Function which add a teacher to db
def db_teachers_add():
# Opening Excel File
# wbDataBase = xw.Book('DataBase.xlsm')
wsDataBase = wbDataBase.sheets['TEACHERS']
# Checking whether all entries are entered
if len(first_name_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(middle_name_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(last_name_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(license_number_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(garage_number_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(car_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(car_number_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(education_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(type_license_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(internship_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
else:
Condition = True
num = 5
while Condition:
if wsDataBase.cells(num, "B").value is None:
wsDataBase.cells(num, "B").value = [
middle_name_box.get() + " " + first_name_box.get() + " " + last_name_box.get(),
license_number_box.get(), garage_number_box.get(), car_box.get(), car_number_box.get(),
middle_name_box.get() + " " + first_name_box.get() + "- маълумоти " + education_box.get() + ", <" +
type_license_box.get() + "> тоифадаги автотранспорт хайдовчиси бўлиб, иш стажи " + internship_box.get() +
" йил, " + car_box.get() + " русумли, давлат рақами " + car_number_box.get()+
" . Ўқитиш хуқуқи берилган гувохномаси бор. "]
Condition = False
else:
num += 1
messagebox.showinfo("Муваффақият хабари", "Ўқитувчи маълумотлар базасига муваффақиятли қўшилди!")
# Removing the old data from cells
first_name_box.delete(0, END)
middle_name_box.delete(0, END)
last_name_box.delete(0, END)
license_number_box.delete(0, END)
garage_number_box.delete(0, END)
car_box.delete(0, END)
car_number_box.delete(0, END)
education_box.delete(0, END)
type_license_box.delete(0, END)
internship_box.delete(0, END)
def db_others_add():
# Opening Excel File
# wbDataBase = xw.Book('DataBase.xlsm')
wsDataBase = wbDataBase.sheets['TEACHERS']
# checking whether all entries are entered
if len(t_first_name_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(t_middle_name_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(t_last_name_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(t_education_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(t_specialization_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
else:
Condition = True
num = 5
while Condition:
if wsDataBase.cells(num, "I").value is None:
wsDataBase.cells(num, "I").value = [
t_middle_name_box.get()+" "+t_first_name_box.get()+" "+t_last_name_box.get(),
"Автотранспорт воситаларининг тузилиши ва техник хизмат кўрсатиш фанидан: " +
t_middle_name_box.get()+" "+t_first_name_box.get()+" маълумоти "+
t_education_box.get()+" , мутахасислиги - "+ t_specialization_box.get()+
", автомобил эксплуатацияси мухандиси."
]
Condition = False
else:
num += 1
# Variables for auto or first aid
if variable_1.get() == "Авто.туз & ЙХК":
wsDataBase.cells(num,"K").value = ["Йўл харакати қоидалари ва харакат хафсизлиги, асосларидан: "+
t_middle_name_box.get()+" "+t_first_name_box.get() +" маълумоти "+t_education_box.get()+
", мутахасислиги - "+t_specialization_box.get() + ", автомобил эксплуатацияси мухандиси. "
]
elif variable_1.get() == "Тиббий ёрдам":
wsDataBase.cells(num,"L").value = ["Тиббий ёрдам кўрсатишдан: "+
t_middle_name_box.get()+" "+t_first_name_box.get() +" маълумоти "+t_education_box.get()]
wsDataBase.cells(num,"J").value = None
messagebox.showinfo("Муваффақият хабари", "Ўқитувчи маълумотлар базасига муваффақиятли қўшилди!")
# Removing the old data from cells
t_first_name_box.delete(0, END)
t_middle_name_box.delete(0, END)
t_last_name_box.delete(0, END)
t_education_box.delete(0, END)
t_specialization_box.delete(0, END)
# Button for adding the teachers info into db
instructors_add = ttk.Button(instructors_frame, text="Маълумотлар базасига қўшиш", command=db_teachers_add)
instructors_add.grid(row=12, column=0, columnspan=2, pady=5)
others_add = ttk.Button(others_frame, text="Маълумотлар базасига қўшиш", command=db_others_add)
others_add.grid(row=6, column=0, columnspan=2, pady=5)
def teachers_edit(self):
self.hide_all_frames()
self.teachers_edit_frame.pack(fill="both", expand=1)
# Creating a Notebook
teachers_edit_notebook = ttk.Notebook(self.teachers_edit_frame)
teachers_edit_notebook.pack(pady=10, padx=10)
# Initialize frames for notebooks
instructors_edit_frame = ttk.Frame(teachers_edit_notebook)
others_edit_frame = ttk.Frame(teachers_edit_notebook)
# Place frames in the screen
instructors_edit_frame.pack(fill="both", expand=1)
others_edit_frame.pack(fill="both", expand=1)
# Add the notebooks
teachers_edit_notebook.add(instructors_edit_frame, text="Усталapни Янгилаш")
teachers_edit_notebook.add(others_edit_frame, text="Ўқит-ни Янгилаш")
# Opening Excel File
wbDataBase = xw.Book('DataBase.xlsm')
wsDataBase = wbDataBase.sheets['TEACHERS']
# Take the data from excel as python list
Condition = True
num = 5
master = []
while Condition:
if wsDataBase.cells(num, "B").value is not None:
master.append(wsDataBase.cells(num, "B").value)
master.append(wsDataBase.cells(num, "C").value)
master.append(wsDataBase.cells(num, "D").value)
master.append(wsDataBase.cells(num, "E").value)
master.append(wsDataBase.cells(num, "F").value)
num += 1
else:
Condition = False
masters = [master[x:x + 5] for x in range(0, len(master), 5)]
# print("Masters: " + str(masters))
# "Усталap" - First notebook
# global function for the Option Menu
def option_menu_test(*args):
# Remove the old data from cells
first_name_box.delete(0, END)
middle_name_box.delete(0, END)
last_name_box.delete(0, END)
license_number_box.delete(0, END)
garage_number_box.delete(0, END)
car_box.delete(0, END)
car_number_box.delete(0, END)
education_box.delete(0, END)
type_license_box.delete(0, END)
internship_box.delete(0, END)
# print(variable_master.get())
record_selected = []
for records in masters:
if records[0] == variable_master.get():
record_selected = records
# print("Records: " + str(record_selected))
first_name_box.insert(0, record_selected[0].split()[0])
middle_name_box.insert(0, record_selected[0].split()[1])
last_name_box.insert(0, record_selected[0].split()[2])
license_number_box.insert(0, (record_selected[1]))
garage_number_box.insert(0, (record_selected[2]))
car_box.insert(0, (record_selected[3]))
car_number_box.insert(0, (record_selected[4]))
education_box.insert(0, "-")
type_license_box.insert(0, "-")
internship_box.insert(0, "-")
OptionListForInstructors = []
for pos in range(len(masters)):
OptionListForInstructors.append(masters[pos][0])
# print(OptionListForInstructors)
# Cheack whether the list is empty
if len(OptionListForInstructors) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, аввал ўқитувчиларни маълумотлар базасига қўшинг!")
variable_master = tk.StringVar(instructors_edit_frame)
variable_master.set(OptionListForInstructors[0])
opt_i = ttk.OptionMenu(instructors_edit_frame, variable_master, OptionListForInstructors[0], *OptionListForInstructors, command=option_menu_test)
opt_i.config(width=30)
opt_i.grid(row=0, column=0, columnspan=2, pady=5)
# Labels for the first notebook
first_name_label = ttk.Label(instructors_edit_frame, text="Исм").grid(row=1, column=0, padx=10)
middle_name_label = ttk.Label(instructors_edit_frame, text="Фамилия").grid(row=2, column=0, padx=10)
last_name_label = ttk.Label(instructors_edit_frame, text="Отчество").grid(row=3, column=0, padx=10)
license_number_label = ttk.Label(instructors_edit_frame, text="Х/Г №").grid(row=4, column=0, padx=10)
garage_number_label = ttk.Label(instructors_edit_frame, text="Гар. №").grid(row=5, column=0, padx=10)
car_label = ttk.Label(instructors_edit_frame, text="Марка").grid(row=6, column=0, padx=10)
car_number_label = ttk.Label(instructors_edit_frame, text="Гос. №").grid(row=7, column=0, padx=10)
application_label = ttk.Label(instructors_edit_frame, text="Заявка учун маълумотлар: ").grid(row=8, column=0, padx=10,columnspan=2)
education_label = ttk.Label(instructors_edit_frame, text="Маълумоти ").grid(row=9, column=0, padx=20)
type_license_label = ttk.Label(instructors_edit_frame, text="Tоифа").grid(row=10, column=0, padx=10)
internship_label = ttk.Label(instructors_edit_frame, text="Стаж").grid(row=11, column=0, padx=10)
# Create entry boxes for the first notebook
first_name_box = ttk.Entry(instructors_edit_frame)
first_name_box.grid(row=1, column=1, pady=3, padx=7)
middle_name_box = ttk.Entry(instructors_edit_frame)
middle_name_box.grid(row=2, column=1, pady=3)
last_name_box = ttk.Entry(instructors_edit_frame)
last_name_box.grid(row=3, column=1, pady=3)
license_number_box = ttk.Entry(instructors_edit_frame)
license_number_box.grid(row=4, column=1, pady=3)
garage_number_box = ttk.Entry(instructors_edit_frame)
garage_number_box.grid(row=5, column=1, pady=3)
car_box = ttk.Entry(instructors_edit_frame)
car_box.grid(row=6, column=1, pady=3)
car_number_box = ttk.Entry(instructors_edit_frame)
car_number_box.grid(row=7, column=1, pady=3)
education_box = ttk.Entry(instructors_edit_frame)
education_box.grid(row=9, column=1, pady=3)
type_license_box = ttk.Entry(instructors_edit_frame)
type_license_box.grid(row=10, column=1, pady=3)
internship_box = ttk.Entry(instructors_edit_frame)
internship_box.grid(row=11, column=1, pady=3)
# "Ўқитувчилар" -- Second notebook
# Ikkinchi Notebook
Condition_2 = True
num = 5
master_2 = []
while Condition_2:
if wsDataBase.cells(num, "I").value is not None:
master_2.append(wsDataBase.cells(num, "I").value)
master_2.append(wsDataBase.cells(num, "G").value)
master_2.append(wsDataBase.cells(num, "K").value)
master_2.append(wsDataBase.cells(num, "L").value)
num += 1
else:
Condition_2 = False
masters_2 = [master_2[x:x + 4] for x in range(0, len(master_2), 4)]
def option_menu_test2(*args):
# Remove the old data from cells
t_first_name_box.delete(0, END)
t_middle_name_box.delete(0, END)
t_last_name_box.delete(0, END)
t_education_box.delete(0, END)
t_specialization_box.delete(0, END)
# print(variable_master.get())
record_selected = []
for records in masters_2:
if records[0] == variable_others.get():
record_selected = records
# print("Records: " + str(record_selected))
t_first_name_box.insert(0, record_selected[0].split()[0])
t_middle_name_box.insert(0, record_selected[0].split()[1])
t_last_name_box.insert(0, record_selected[0].split()[2])
t_education_box.insert(0, "-")
t_specialization_box.insert(0,'-')
OptionListForOthers = []
for pos in range(len(masters_2)):
OptionListForOthers.append(masters_2[pos][0])
# Cheack whether the list is empty
if len(OptionListForOthers) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, аввал ўқитувчиларни маълумотлар базасига қўшинг!")
variable_others = tk.StringVar(others_edit_frame)
variable_others.set(OptionListForOthers[0])
opt_o = ttk.OptionMenu(others_edit_frame, variable_others, OptionListForOthers[0], *OptionListForOthers, command=option_menu_test2)
opt_o.config(width=30)
opt_o.grid(row=0, column=0, columnspan=2, padx=10, pady=5)
# Create Lables for the second notebook
t_first_name_label = ttk.Label(others_edit_frame, text="Исм").grid(row=1, column=0, padx=10)
t_middle_name_label = ttk.Label(others_edit_frame, text="Фамилия").grid(row=2, column=0, padx=10)
t_last_name_label = ttk.Label(others_edit_frame, text="Отчество").grid(row=3, column=0, padx=10)
t_education_label = ttk.Label(others_edit_frame, text="Маълумоти").grid(row=4, column=0, padx=10)
t_specialization_label = ttk.Label(others_edit_frame, text="Мутахасислиги").grid(row=5, column=0, padx=10)
# Create Entry Box for the second notebook
t_first_name_box = ttk.Entry(others_edit_frame)
t_first_name_box.grid(row=1, column=1, pady=3, padx=7)
t_middle_name_box = ttk.Entry(others_edit_frame)
t_middle_name_box.grid(row=2, column=1, pady=3)
t_last_name_box = ttk.Entry(others_edit_frame)
t_last_name_box.grid(row=3, column=1, pady=3)
t_education_box = ttk.Entry(others_edit_frame)
t_education_box.grid(row=4, column=1, pady=3)
t_specialization_box = ttk.Entry(others_edit_frame)
t_specialization_box.grid(row=5, column=1, pady=3)
# Functions which add a teacher to db
def db_teachers_edit():
record_selected = []
for records in masters:
if records[0] == variable_master.get():
record_selected = records
# checking whether all entries are full
if len(first_name_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(middle_name_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(last_name_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(license_number_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(garage_number_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(car_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(car_number_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(education_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(type_license_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(internship_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
else:
Condition = True
num = 5
while Condition:
if wsDataBase.cells(num, "B").value == record_selected[0]:
wsDataBase.cells(num, "B").value = [
middle_name_box.get() + " " + first_name_box.get() + " " + last_name_box.get(),
license_number_box.get(), garage_number_box.get(), car_box.get(), car_number_box.get(),
middle_name_box.get() + " " + first_name_box.get() + "- маълумоти " + education_box.get() + ", <" +
type_license_box.get() + "> тоифадаги автотранспорт хайдовчиси бўлиб, иш стажи " + internship_box.get() +
" йил, " + car_box.get() + " русумли, давлат рақами " + car_number_box.get()]
Condition = False
else:
num += 1
messagebox.showinfo("Муваффақият хабари", "Ўқитувчи маълумотлар базасидан муваффақиятли янгиланди!")
# removing the old data from cells
first_name_box.delete(0, END)
middle_name_box.delete(0, END)
last_name_box.delete(0, END)
license_number_box.delete(0, END)
garage_number_box.delete(0, END)
car_box.delete(0, END)
car_number_box.delete(0, END)
education_box.delete(0, END)
type_license_box.delete(0, END)
internship_box.delete(0, END)
def db_others_edit():
record_selected = []
for records in masters_2:
if records[0] == variable_others.get():
record_selected = records
# checking whether all entries are full
if len(t_first_name_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(t_middle_name_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(t_last_name_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(t_education_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(t_specialization_box.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
else:
Condition_2 = True
num = 5
while Condition_2:
if wsDataBase.cells(num, "I").value == record_selected[0]:
wsDataBase.cells(num, "I").value = [
t_middle_name_box.get()+" "+t_first_name_box.get()+" "+t_last_name_box.get(),
"Автотранспорт воситаларининг тузилиши ва техник хизмат кўрсатиш фанидан: " +
t_middle_name_box.get()+" "+t_first_name_box.get()+" маълумоти "+
t_education_box.get()+" , мутахасислиги - "+ t_specialization_box.get()+
", автомобил эксплуатацияси мухандиси."
]
Condition_2 = False
else:
num += 1
if wsDataBase.cells(num,"K").value == None:
wsDataBase.cells(num,"L").value = ["Тиббий ёрдам кўрсатишдан: "+
t_middle_name_box.get()+" "+t_first_name_box.get() +" маълумоти "+t_education_box.get()]
wsDataBase.cells(num,"J").value = None
else:
wsDataBase.cells(num,"K").value = ["Йўл харакати қоидалари ва харакат хафсизлиги, асосларидан: "+
t_middle_name_box.get()+" "+t_first_name_box.get() +" маълумоти "+t_education_box.get()+
", мутахасислиги - "+t_specialization_box.get() + ", автомобил эксплуатацияси мухандиси. "
]
messagebox.showinfo("Муваффақият хабари", "Ўқитувчи маълумотлар базасидан муваффақиятли янгиланди!")
# removing the old data from cells
t_first_name_box.delete(0, END)
t_middle_name_box.delete(0, END)
t_last_name_box.delete(0, END)
t_education_box.delete(0, END)
t_specialization_box.delete(0, END)
# Button for saving the info into db
instructors_edit = ttk.Button(instructors_edit_frame, text="Маълумотлар базасини янгилаш",
command=db_teachers_edit)
instructors_edit.grid(row=12, column=0, columnspan=2, pady=5)
others_edit = ttk.Button(others_edit_frame, text="Маълумотлар базасини янгилаш", command=db_others_edit)
others_edit.grid(row=6, column=0, columnspan=2, pady=5)
def teachers_delete(self):
self.hide_all_frames()
self.teachers_delete_frame.pack(fill="both", expand=1)
param = ttk.Label(self.teachers_delete_frame, text="Ўчирмоқчи бўлган ўқитувчини танланг: ")
param.pack(padx=10, pady=10)
# Opening Excel File
wbDataBase = xw.Book('DataBase.xlsm')
wsDataBase = wbDataBase.sheets['TEACHERS']
# Taking data from excel as list
Condition = True
num = 5
master = []
while Condition:
if wsDataBase.cells(num, "B").value is not None:
master.append(wsDataBase.cells(num, "B").value)
master.append(wsDataBase.cells(num, "C").value)
master.append(wsDataBase.cells(num, "D").value)
master.append(wsDataBase.cells(num, "E").value)
master.append(wsDataBase.cells(num, "F").value)
master.append(wsDataBase.cells(num, "G").value)
num += 1
else:
Condition = False
masters = [master[x:x + 6] for x in range(0, len(master), 6)]
Condition_2 = True
num_2 = 5
master_2 = []
while Condition_2:
if wsDataBase.cells(num_2, "I").value is not None:
master_2.append(wsDataBase.cells(num_2, "I").value)
master_2.append(wsDataBase.cells(num_2, "J").value)
master_2.append(wsDataBase.cells(num_2, "K").value)
master_2.append(wsDataBase.cells(num_2, "L").value)
num_2 += 1
else:
Condition_2 = False
masters_2 = [master_2[x:x + 4] for x in range(0, len(master_2), 4)]
# print(masters_2)
OptionList = []
for pos in range(len(masters)):
OptionList.append(masters[pos][0])
for pos in range(len(masters_2)):
OptionList.append(masters_2[pos][0])
variable = tk.StringVar(self.teachers_delete_frame)
variable.set(OptionList[0])
opt = ttk.OptionMenu(self.teachers_delete_frame, variable, OptionList[0], *OptionList)
opt.config(width=50)
opt.pack(side="top")
labelTest = ttk.Label(self.teachers_delete_frame, text="Танланган элемент - {}".format(OptionList[0]))
labelTest.pack(side="top", pady=10, padx=10)
def callback(*args):
labelTest.configure(text="Танланган элемент - {}".format(variable.get()))
variable.trace("w", callback)
def delete():
num = 5
wsDataBase.range("B5:G59").value = None
for records in masters:
if records[0] != variable.get():
wsDataBase.cells(num, "B").value = [
records[0],
records[1],
records[2],
records[3],
records[4],
records[5]]
num += 1
num_2 = 5
wsDataBase.range("I5:L34").value = None
for records in masters_2:
if records[0] != variable.get():
wsDataBase.cells(num_2, "I").value = [
records[0],
records[1],
records[2],
records[3] ]
num_2 += 1
messagebox.showinfo("Муваффақият хабари", "Ўқитувчи маълумотлар базасидан муваффақиятли ўчирилди!")
# Create a Delete Button
delete_btn = ttk.Button(self.teachers_delete_frame, text="Ўчириш", command=delete)
delete_btn.pack()
# Create methods for Groups
def groups_add(self):
# ================= Opening Excel ================
wbDataBase = xw.Book('DataBase.xlsm')
wsDataBase = wbDataBase.sheets['TEACHERS']
wsDataBaseGR = wbDataBase.sheets['DATABASE']
self.hide_all_frames()
self.groups_add_frame.pack(fill="both", expand=1)
# Create a Notebook
groups_notebook = ttk.Notebook(self.groups_add_frame)
groups_notebook.pack(pady=10, padx=10)
# Initialize frames for notebooks
groups_inside_frame = ttk.Frame(groups_notebook)
groups_inside_frame.pack()
# Add the notebook
groups_notebook.add(groups_inside_frame, text="Гуруҳ Қўшиш")
# "Guruhlar" - Labels, boxes, and OptionMenus
group_number_label = ttk.Label(groups_inside_frame, text="Гуруҳ №").grid(row=0, column=0)
groups_number_entry = ttk.Entry(groups_inside_frame)
groups_number_entry.grid(row=0, column=1, padx=5, pady=10)
first_name_label = ttk.Label(groups_inside_frame, text="Тоифа").grid(row=0, column=2, padx=10)
OptionList_Typee = ["BC", "A", "B", "C", "D", "BE", "CE", "DE"]
variable_type = tk.StringVar(groups_inside_frame)
variable_type.set(OptionList_Typee[0])
opt = ttk.OptionMenu(groups_inside_frame, variable_type, OptionList_Typee[0], *OptionList_Typee)
opt.config(width=16)
opt.grid(row=0, column=3, padx=10, pady=10)
time_duration_label = ttk.Label(groups_inside_frame, text=" Ўқиш\nМуддати").grid(row=1, column=0)
time_duration_entry = ttk.Entry(groups_inside_frame)
time_duration_entry.grid(row=1, column=1, padx=5, pady=10)
# Add a data picker
groups_date_label = ttk.Label(groups_inside_frame, text="Сана").grid(row=1, column=2, padx=10)
cal = DateEntry(groups_inside_frame, width=19, bg="darkblue", fg="white", locale="uz_UZ")
cal.grid(row=1, column=3, padx=10, pady=10)
# print(cal.get_date())
lecture_duration_label = ttk.Label(groups_inside_frame, text="Назарий машғулот\n соати").grid(row=2, column=0, padx=10)
OptionList_L_start = ["6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "17", "18", "19", "20"]
variable_l_start = tk.StringVar(groups_inside_frame)
variable_l_start.set(OptionList_L_start[0])
opt = ttk.OptionMenu(groups_inside_frame, variable_l_start, OptionList_L_start[0], *OptionList_L_start)
opt.config(width=16)
opt.grid(row=2, column=1, padx=10, pady=10)
lecture_duration_label_2 = ttk.Label(groups_inside_frame, text="дан / гача").grid(row=2, column=2, padx=5)
OptionList_L_finish = ["6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "17", "18", "19", "20"]
variable_l_finish = tk.StringVar(groups_inside_frame)
variable_l_finish.set(OptionList_L_finish[0])
opt = ttk.OptionMenu(groups_inside_frame, variable_l_finish, OptionList_L_finish[0], *OptionList_L_finish)
opt.config(width=16)
opt.grid(row=2, column=3, padx=10, pady=10)
practice_duration_label = ttk.Label(groups_inside_frame, text="Амалий машғулот\n соати").grid(row=3, column=0, padx=10)
OptionList_P_start = ["6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "17", "18", "19", "20"]
variable_p_start = tk.StringVar(groups_inside_frame)
variable_p_start.set(OptionList_P_start[0])
opt = ttk.OptionMenu(groups_inside_frame, variable_p_start, OptionList_P_start[0], *OptionList_P_start)
opt.config(width=16)
opt.grid(row=3, column=1, padx=10, pady=10)
practice_duration_label_2 = ttk.Label(groups_inside_frame, text="дан / гача").grid(row=3, column=2, padx=5)
OptionList_P_finish = ["6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "17", "18", "19", "20"]
variable_p_finish = tk.StringVar(groups_inside_frame)
variable_p_finish.set(OptionList_P_finish[0])
opt = ttk.OptionMenu(groups_inside_frame, variable_p_finish, OptionList_P_finish[0], *OptionList_P_finish)
opt.config(width=16)
opt.grid(row=3, column=3, padx=10, pady=10)
# ================= Opening Excel ================
# wbDataBase = xw.Book('DataBase.xlsm')
wsDataBase = wbDataBase.sheets['TEACHERS']
# Ustalar List from database
Condition_2 = True
num = 5
master_2 = []
while Condition_2:
if wsDataBase.cells(num, "I").value is not None:
master_2.append(wsDataBase.cells(num, "I").value)
master_2.append(wsDataBase.cells(num, "G").value)
master_2.append(wsDataBase.cells(num, "K").value)
master_2.append(wsDataBase.cells(num, "L").value)
num += 1
else:
Condition_2 = False
masters_2 = [master_2[x:x + 4] for x in range(0, len(master_2), 4)]
# O'qituvchilar List
Condition = True
num = 5
master = []
while Condition:
if wsDataBase.cells(num, "B").value is not None:
master.append(wsDataBase.cells(num, "B").value)
master.append(wsDataBase.cells(num, "C").value)
master.append(wsDataBase.cells(num, "D").value)
master.append(wsDataBase.cells(num, "E").value)
master.append(wsDataBase.cells(num, "F").value)
master.append(wsDataBase.cells(num, "G").value)
num += 1
else:
Condition = False
masters = [master[x:x + 6] for x in range(0, len(master), 6)]
teacher_name_label = ttk.Label(groups_inside_frame, text=" Ўқитувчи\nАвто.туз, ЙХК").grid(row=4, column=0)
OptionList_Teacher = []
for pos in range(len(masters_2)):
OptionList_Teacher.append(masters_2[pos][0])
variable_teacher_name = tk.StringVar(groups_inside_frame)
variable_teacher_name.set(OptionList_Teacher[0])
opt = ttk.OptionMenu(groups_inside_frame, variable_teacher_name, OptionList_Teacher[0], *OptionList_Teacher)
opt.config(width=16)
opt.grid(row=4, column=1, padx=10, pady=10)
doctor_name_label = ttk.Label(groups_inside_frame, text=" Ўқитувчи\nТиббий ёрдам").grid(row=4, column=2)
OptionList_doctor = []
for pos in range(len(masters_2)):
OptionList_doctor.append(masters_2[pos][0])
variable_doctor_name = tk.StringVar(groups_inside_frame)
variable_doctor_name.set(OptionList_doctor[0])
opt = ttk.OptionMenu(groups_inside_frame, variable_doctor_name, OptionList_doctor[0], *OptionList_doctor)
opt.config(width=16)
opt.grid(row=4, column=3, padx=10, pady=10)
# Masters
OptionList_Masrer = []
for pos in range(len(masters)):
OptionList_Masrer.append(masters[pos][0])
o_vars = []
ttk.Label(groups_inside_frame, text="Уста Ўргатувчи").grid(row=5, column=0)
for i in range(3):
variable_masters = tk.StringVar(groups_inside_frame)
variable_masters.set(OptionList_Masrer[0])
o_vars.append(variable_masters)
opt = ttk.OptionMenu(groups_inside_frame, variable_masters, OptionList_Masrer[0], *OptionList_Masrer)
opt.config(width=16)
opt.grid(row=5, column=1+i, pady=10)
def db_groups_add():
# masters_counter = 0
# for i, var in enumerate(o_vars):
# masters_counter += 1
# # print(var.get())
# checking whether all entries are full
masters_counter = 1
if len(groups_number_entry.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(variable_type.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(time_duration_entry.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(variable_l_start.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(variable_l_finish.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(variable_p_start.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(variable_p_finish.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(variable_teacher_name.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif len(variable_doctor_name.get()) == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
elif masters_counter == 0:
messagebox.showwarning("Огоҳлантириш хабари!", "Илтимос, барча ёзувларни тўлдиринг!")
else:
# Group Datas
wsDataBaseGR.range("B3").value = groups_number_entry.get()
wsDataBaseGR.range("D3").value = variable_type.get()
wsDataBaseGR.range("E3").value = time_duration_entry.get()
wsDataBaseGR.range("F3").value = cal.get_date()
wsDataBaseGR.range("H3").value = variable_l_start.get()
wsDataBaseGR.range("I3").value = variable_l_finish.get()
wsDataBaseGR.range("J3").value = variable_p_start.get()
wsDataBaseGR.range("K3").value = variable_p_finish.get()
# Ustalar
record_selected = []
for records in masters_2:
if records[0] == variable_teacher_name.get():
record_selected = records
wsDataBaseGR.range("C6").value = [record_selected[0],
record_selected[1], record_selected[2],record_selected[3]]
record_selected = []
for records in masters_2:
if records[0] == variable_doctor_name.get():
record_selected = records
wsDataBaseGR.range("C7").value = [record_selected[0],
" ", " ",record_selected[3]]
# O'qituvchilar
masters_counter = 0
for i, var in enumerate(o_vars):
masters_counter += 1
if masters_counter == 1:
for records in masters:
if records[0] == var.get():
record_selected = records
wsDataBaseGR.range("C10").value =[record_selected[0],
record_selected[1],record_selected[2],record_selected[3],record_selected[4],
record_selected[5]]
if masters_counter == 2:
for records in masters:
if records[0] == var.get():
record_selected = records
wsDataBaseGR.range("C11").value =[record_selected[0],
record_selected[1],record_selected[2],record_selected[3],record_selected[4],
record_selected[5]]
if masters_counter == 3:
for records in masters:
if records[0] == var.get():
record_selected = records
wsDataBaseGR.range("C12").value =[record_selected[0],
record_selected[1],record_selected[2],record_selected[3],record_selected[4],
record_selected[5]]
# Saving File as new Excel
wbnamedir = "Guruh " + str(groups_number_entry.get())
wbDataBase.save('groups\{}.xlsm'.format(wbnamedir))
wbDataBase.close()
messagebox.showinfo("Муваффақият хабари", "Ўқитувчи маълумотлар базасига муваффақиятли қўшилди!")
# Remove the old data from cells
groups_number_entry.delete(0, END)
time_duration_entry.delete(0, END)
# Button for saving the info into db
groups_add = ttk.Button(groups_inside_frame, text="Маълумотлар базасига қўшиш", command=db_groups_add)
groups_add.grid(row=6, column=1, columnspan=2, pady=5)
def groups_edit(self):
self.hide_all_frames()
self.groups_edit_frame.pack(fill="both", expand=1)
# Create a Notebook
groups_edit_notebook = ttk.Notebook(self.groups_edit_frame)
groups_edit_notebook.pack(pady=10, padx=10)
# Initialize frames for notebooks
groups_edit_inside_frame = ttk.Frame(groups_edit_notebook)
groups_edit_inside_frame.pack()
# Add the notebook
groups_edit_notebook.add(groups_edit_inside_frame, text="Гуруҳ Янгилаш")
OptionListForGroupsEdit = [
"Groups Edit",
"Umarov",
"Shavkatov",
"Usmanov",
"Rustamov"
]