私はいくつかの入力ウィジェットを入力として持つtkinterインターフェースを持っています。ボタンをクリックすると、これらの入力を処理する別のスクリプトに送信し、値を印刷してボタンに返すことができます(私は二重精度評価統計のためにこれを検討しています)別のスクリプトにtkinterボタンをリンクする
これはGUI_ConnectorScript
def calculate():
global result
result = int(entry.get())
result += 1
print result
プライマリスクリプト:GUI_ConnectorScript
from Tkinter import *
import GUI_ConnectorScript
background = "#A8A8A8"
master = Tk()
screen_width = master.winfo_screenwidth()
screen_height = master.winfo_screenheight()
width = int(screen_width*0.7)
height = int(screen_height*0.7)
size = "%sx%s"%(width,height)
master.geometry(size)
master.title("GIS Display")
text = Text(master, width = 80, height = 40, background = background)
text.pack(expand = TRUE, fill = BOTH)
entry = Entry(master, width=5).place(x=100,y=100)
button = Button(master, text="Calculate", command=GUI_ConnectorScript).place(x=500,y=500)
mainloop()
私はこれまでと
例セカンダリスクリプトを達成するために探しています持っているものの低スケールの例3210
私はこれをしばらく考え出し、答えをたくさん見てきました。同様の例が見つかりましたが、私のアプリケーションでうまく動作するようになっています。
のためにそのはるかに良い代わりのTkinterのkivyを(可能な場合)、使用アドバイスを進めることができます。 –