【发布时间】:2020-01-24 21:02:09
【问题描述】:
我正在使用 tkinter 制作一个程序,该程序执行来自不同文件的一些代码。
这是我的代码导致问题的部分:
text=textbox.get('1.0','end-1c')
仅供参考:textbox 是一个 tkinter.Text 对象,由我的代码执行的不同文件定义
当我执行我的代码时,我得到了错误:
Exception in Tkinter callback
Traceback (most recent call last):
File "/anaconda3/lib/python3.7/tkinter/__init__.py", line 1705, in __call__
return self.func(*args)
File "/Users/iskee/python/programs/atfedit/atf.py", line 98, in save
text=textbox.get('1.0','end-1c')
File "/anaconda3/lib/python3.7/tkinter/__init__.py", line 3246, in get
return self.tk.call(self._w, 'get', index1, index2)
_tkinter.TclError: invalid command name ".!text"
出了什么问题?
【问题讨论】:
标签: python-3.x tkinter