作者hsiaoeddie (eddie)
看板Python
標題[問題] tkinter找不到屬性Tk()
時間Wed Apr 17 20:33:54 2019
最近在學習tkinter,使用spyder寫了下列程式
https://i.imgur.com/chMRGXP.jpg
但卻顯示
AttributeError: module 'tkinter' has no attribute 'Tk'
-----
Sent from JPTT on my iPhone
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.205.14.121
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Python/M.1555504436.A.EFA.html
1F:→ HenryLiKing: 你應該是檔名取到 tkinter 了 注意一下檔名 04/17 20:52
我在網路爬文有發現這個問題,但我已經把檔名改成abc.py了仍然會跑出錯誤訊息
※ 編輯: hsiaoeddie (42.76.172.204), 04/18/2019 09:00:20
2F:推 thefattiger: tkinter.__dict__檢查一下 04/18 20:49
3F:推 lemon651: 同個資料夾內有tkinker嗎 04/19 10:33
4F:→ samuelc: 我只注意到最後一行 Mainpool 04/19 23:20
哈哈哈哈我發現了,該回來了
※ 編輯: hsiaoeddie (123.205.14.121), 04/20/2019 20:01:09
5F:推 Samchen: 加一行 from tkinter import * ? 04/28 10:01