here2share

# Tk_weights_demo.py

May 24th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.40 KB | None | 0 0
  1. # Tk_weights_demo.py
  2.  
  3. import Tkinter as tk
  4.  
  5. root = tk.Tk()
  6. root.geometry("200x100")
  7.  
  8. f1 = tk.Frame(root, background="bisque", width=10, height=100)
  9. f2 = tk.Frame(root, background="pink", width=10, height=100)
  10.  
  11. f1.grid(row=0, column=0, sticky="nsew")
  12. f2.grid(row=0, column=1, sticky="nsew")
  13.  
  14. root.grid_columnconfigure(0, weight=0)
  15. root.grid_columnconfigure(1, weight=0)
  16.  
  17. root.mainloop()
  18.  
  19.  
  20. root = tk.Tk()
  21. root.geometry("200x100")
  22.  
  23. f1 = tk.Frame(root, background="bisque", width=10, height=100)
  24. f2 = tk.Frame(root, background="pink", width=10, height=100)
  25.  
  26. f1.grid(row=0, column=0, sticky="nsew")
  27. f2.grid(row=0, column=1, sticky="nsew")
  28.  
  29. root.grid_columnconfigure(0, weight=1)
  30.  
  31. root.mainloop()
  32.  
  33.  
  34. root = tk.Tk()
  35. root.geometry("200x100")
  36.  
  37. f1 = tk.Frame(root, background="bisque", width=10, height=100)
  38. f2 = tk.Frame(root, background="pink", width=10, height=100)
  39.  
  40. f1.grid(row=0, column=0, sticky="nsew")
  41. f2.grid(row=0, column=1, sticky="nsew")
  42.  
  43. root.grid_columnconfigure(0, weight=1)
  44. root.grid_columnconfigure(1, weight=3)
  45.  
  46. root.mainloop()
  47.  
  48.  
  49. root = tk.Tk()
  50. root.geometry("600x100")
  51.  
  52. f1 = tk.Frame(root, background="bisque", width=10, height=100)
  53. f2 = tk.Frame(root, background="pink", width=10, height=100)
  54.  
  55. f1.grid(row=0, column=0, sticky="nsew")
  56. f2.grid(row=0, column=1, sticky="nsew")
  57.  
  58. root.grid_columnconfigure(0, weight=1)
  59. root.grid_columnconfigure(1, weight=3)
  60.  
  61. root.mainloop()
Add Comment
Please, Sign In to add comment