獲取entry的值並將其轉化爲int

e1 = Entry()
e1.place(x=130,y=30)
t1 = Text(root,height=1,)
t1.place(x=130,y=70)


def cal():
    left = 0
    right = 0
    angle = e1.get()
    angle = int(angle)
    print(type(angle))
放在定義的函數裏邊
最後會得到結果
<class 'int'>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章