tk10_frame.py 646 B

1234567891011121314151617181920212223242526272829303132
  1. # View more python learning tutorial on my Youtube and Youku channel!!!
  2. # Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
  3. # Youku video tutorial: http://i.youku.com/pythontutorial
  4. import tkinter as tk
  5. window = tk.Tk()
  6. window.title('my window')
  7. window.geometry('200x200')
  8. tk.Label(window, text='on the window').pack()
  9. frm = tk.Frame(window)
  10. frm.pack()
  11. frm_l = tk.Frame(frm, )
  12. frm_r = tk.Frame(frm)
  13. frm_l.pack(side='left')
  14. frm_r.pack(side='right')
  15. tk.Label(frm_l, text='on the frm_l1').pack()
  16. tk.Label(frm_l, text='on the frm_l2').pack()
  17. tk.Label(frm_r, text='on the frm_r1').pack()
  18. window.mainloop()