0xCor3

Tkinter While

Sep 22nd, 2020 (edited)
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. from tkinter import *
  2.  
  3. root = Tk()
  4. root.title("Kelompok 6")
  5. #list
  6. list_anggota = {
  7.     'Izzeldin Addarda': '41519010045',
  8.     'Akbar Basyarudin': '41519010046',
  9.     'Ridho Aditya N'  : '41519010050'
  10. }
  11. #frame ke 2
  12. teks = ""
  13. i = 0
  14. while i < len(list_anggota): # create teks body
  15.     val = list(list_anggota.items())[i]
  16.     teks += "Anggota {} {}, {}\n".format(str(i+1), str(val[0]), str(val[1]))
  17.     i += 1
  18. frame2 = LabelFrame(root, text="Kelompok 6 : ", bd=8, bg="white")
  19. Label(frame2, text=teks, fg='red', bg='white').pack()
  20. frame2.pack(expand=YES, fill=BOTH)
  21.  
  22. #Quit Button
  23. Button(text="QUIT", fg="red", command=root.destroy).pack(side=BOTTOM)
  24.  
  25. mainloop()
Add Comment
Please, Sign In to add comment