私は、複数のメニューとボタンを使用し、メニューを素早く作成するプログラムを作成しています(私はTkinterに堪能ではありません)。しかし、ボタンごとに非常に長い.configure文が出力されています。つまり、私のプロジェクトは現在1400行以上のコードを集めています。これらの.configureコマンドをすべて1つにする方法はありますか?私は参照のために私のコードのサンプルを以下に含めました。TKinterの.configureを1つのコマンドに集約するにはどうすればいいですか?
self.Button7 = Button(top)
self.Button7.place(relx=0.04, rely=0.76, height=24, width=257)
self.Button7.configure(activebackground="#d9d9d9")
self.Button7.configure(activeforeground="#000000")
self.Button7.configure(background="#d9d9d9")
self.Button7.configure(command=root.destroy)
self.Button7.configure(disabledforeground="#a3a3a3")
self.Button7.configure(foreground="#000000")
self.Button7.configure(highlightbackground="#d9d9d9")
self.Button7.configure(highlightcolor="black")
self.Button7.configure(pady="0")
self.Button7.configure(text='''Go back''')
「ページ」とは何ですか? –