Advertisement
Guest User

new

a guest
Mar 21st, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.41 KB | None | 0 0
  1. from tkinter import *
  2. alph = ['A', 'B', 'C', 'D', 'E', 'F']
  3. root = Tk()
  4.  
  5. button_var = {}
  6. i = 0
  7.  
  8.  
  9. def ins():
  10.     global button_var, i
  11.     button_var[i] = Entry(root, width=30)
  12.     tes_create.grid(row=i+8, column=1)
  13.     button_var[i].grid(row=i+7, column=1)
  14.     i = i + 1
  15.  
  16.  
  17. test = open(r'D:\test.txt', 'w')
  18.  
  19. name_test_label = Label(root,
  20.                         text='Введите название теста:',
  21.                         width=25, height=2,
  22.                         fg='black')
  23. name_test_read = Entry(root,
  24.                        width=30)
  25. q_read = Entry(root, width=30)
  26. tes_question = Label(root, text='Введите вопрос', width=25, height=2)
  27. variant = Label(root, text='Введите вариант ответа', width=25, height=2)
  28. tes_variant_read = Entry(root, width=30)
  29. tes_give_var = Button(root, text='Добавить вариант', width=15, height=1, command=ins)
  30. give_quest = Button(root, text='Добавить вопрос', width=15, height=1)
  31. tes_create = Button(root, text='Создать вопрос', width=12, height=1)
  32.  
  33. name_test_label.grid(row=1, column=1)
  34. name_test_read.grid(row=2, column=1)
  35. tes_question.grid(row=3, column=1)
  36. q_read.grid(row=4, column=1)
  37. give_quest.grid(row=4, column=2)
  38. variant.grid(row=5, column=1)
  39. tes_variant_read.grid(row=6, column=1)
  40. tes_give_var.grid(row=6, column=2)
  41. tes_create.grid(row=7, column=1)
  42.  
  43. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement