def img_2_text():
T.delete(0,END)
#clear previous contents in Text
报错:
TclError: bad text index "0"
原因:对于Text widget 0 为无效index ,应该改为1
0 is an invalid index for a text widget. In a text widget, you need to use ‘1.0’ instead of ‘0’. – Korzak Mar 8 '19 at 20:28
解决方案:
stackoverflow
试一下,解决:
def img_2_text():
T.delete(1,END)
#! 如果1不成功,试一下‘1.0’
原因:系统某些时候不识别IDLE中输入的整数
def click():
OutputBox.delete('1.0', END)
Sometimes system doesn’t support integer when you try it to run in IDLE, I know its frustrating but yeah this sure works.