看板 Python 關於我們 聯絡資訊
大家好 我是Python新手 有需要的時候拿來做個小tool這樣的程度 現在需要做一個比較大型的AP 需要有UI 我用的環境如下 Python3.5 IDE:Pycharm UI用tkcon生成 有2個檔案 test.py test_Support.py test.py裡面描述所有UI的部分 包含List Text label Button等 root = Tk() test_support.set_Tk_var() top = New_Toplevel_1(root) test_support.init(root, top) root.mainloop() class New_Toplevel_1: def __init__(self, top=None): self.Text1 = Text(top) self.Text1.place(relx=0.0, rely=0.54, relheight=0.36, relwidth=1.0) self.Text1.configure(background="white") 大概像是這樣的內容 Text1要顯示log訊息 我要在test_Support.py中做邏輯操作再把訊息打在Text1上 可是我不知道該如何做 有試過test.Text1.insert(), self.Text1.insert等 都報錯 不存在的變數 未定義之類的 請各位版友知道的不吝指導 感恩 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.250.205.229 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1509092742.A.A32.html
uranusjr: test.top.Text1.insert() 錯誤訊息明明有寫什麼沒定義吧 10/28 05:28