错误:UnboundLocalError:在赋值之前引用了局部变量

2024-09-29 17:19:36 发布

您现在位置:Python中文网/ 问答频道 /正文

当我编译这段代码时:

def compileF():
    file = text.get('1.0', END)
    print(file)
text = Text(root, height=40, width=60, fg="black", font="Helvetica 12")

我得到一个错误:

^{pr2}$

怎么回事?在


Tags: 代码textgetdefrootwidthfileend

热门问题