import tkinter root = tkinter.Tk() root.title('GUIサンプル') root.geometry('400x300') frame = tkinter.Frame(root, borderwidth=2, relief='groove') frame.pack(fill='both', expand=True, padx=5, pady=5) btn = tkinter.Button(frame, text='実行', width=10, height=2) btn.place(relx=0.5, rely=0.5, anchor='center') root.mainloop()