tk12_position.py 859 B

123456789101112131415161718192021222324252627
  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.geometry('200x200')
  7. #canvas = tk.Canvas(window, height=150, width=500)
  8. #canvas.grid(row=1, column=1)
  9. #image_file = tk.PhotoImage(file='welcome.gif')
  10. #image = canvas.create_image(0, 0, anchor='nw', image=image_file)
  11. #tk.Label(window, text='1').pack(side='top')
  12. #tk.Label(window, text='1').pack(side='bottom')
  13. #tk.Label(window, text='1').pack(side='left')
  14. #tk.Label(window, text='1').pack(side='right')
  15. #for i in range(4):
  16. #for j in range(3):
  17. #tk.Label(window, text=1).grid(row=i, column=j, padx=10, pady=10)
  18. tk.Label(window, text=1).place(x=20, y=10, anchor='nw')
  19. window.mainloop()