私はディスプレイの作り方を理解する上で少し問題があります。私は2つの質問があります:どのウィジェットを使うべきですか?そして、私が実際にやりたいことをどうすればいいのですか? Tkinterについてはまだ初心者ですので、混乱しています。私はこの質問を投稿する前にオンラインで検索しようとしましたが、私はもっと混乱させました。誰かが喜んで助けてくれると本当に感謝しています。前もって感謝します!アップデート表示画面?
これまで私がこれまで持っていたことは次のとおりです。
#Imports Tkinter as tk
import Tkinter as tk
root=tk.Tk()
root.title("Phone Dial")
#def display:
#creates a display
#update display when a button is pressed
#continues to list numbers when button is pressed
#ex. only 2 is displayed -> (Button "3" is pressed)-> displays 23
#like a calculator display
#Dial buttons from #0-10
b=tk.Button(root,text="1",bd=5,width="5").grid(row=2,column=1)
b1=tk.Button(root,text="2",bd=5,width="5").grid(row=2,column=2)
b2=tk.Button(root,text="3",bd=5,width="5").grid(row=2,column=3)
b3=tk.Button(root,text="4",bd=5,width="5").grid(row=3,column=1)
b4=tk.Button(root,text="5",bd=5,width="5").grid(row=3,column=2)
b5=tk.Button(root,text="6",bd=5,width="5").grid(row=3,column=3)
b6=tk.Button(root,text="7",bd=5,width="5").grid(row=4,column=1)
b7=tk.Button(root,text="8",bd=5,width="5").grid(row=4,column=2)
b8=tk.Button(root,text="9",bd=5,width="5").grid(row=4,column=3)
b9=tk.Button(root,text="0",bd=5,width="5").grid(row=5,column=2)
root.mainloop()
あなたは(そしてあなたも、 'list'sとメソッドチェーンに見えるかもしれません)Tkinterのアプリケーションを構築する方法にいくつかの研究を行う準備ができているように見えます。私は[Effbot](http://effbot.org/tkinterbook/)をお勧めします。 – TigerhawkT3
イベントドリブンプログラミングを見るとよいでしょう。また、フレームにボタンを置く必要があり、フレームがルートに座っています。 – user5823815
@ user5823815 - 必ずしも 'フレーム'を使う必要はありません。関連アイテムを 'Frame'にグループ化することでアプリを整理すると便利ですが、ルートオブジェクトにウィジェットを追加するだけでかなり複雑なアプリケーションを作成できます。 – TigerhawkT3