import tkinter as tk

root = tk.Tk()
root.title('pack関数')
root.geometry('250x120')

# Labelウィジェットに枠を付け、幅を8文字分にする
label_top = tk.Label(
  root,
  text='TOP',
  relief=tk.SOLID,
  width=8)

label_bottom = tk.Label(
  root,
  text='BOTTOM',
  relief=tk.SOLID,
  width=8)

label_left = tk.Label(
  root,
  text='LEFT',
  relief=tk.SOLID,
  width=8)

label_right = tk.Label(
  root,
  text='RIGHT',
  relief=tk.SOLID,
  width=8)

# sideオプションを指定せずにpack関数を実行
label_top.pack()
label_bottom.pack()
label_left.pack()
label_right.pack()

root.mainloop()
