开发者

Why is Pydev in Eclipse claiming errors on a working program? [duplicate]

This question already has answers here: Closed 12 years ago.

Possible Duplicate:

Eclipse PyDev now shows all references to Tkinter as errors

I have the very simple test project:

from Tkinter import *

win = Tk()
l = Label(win, text="Hello, TKInter")
l.pack()

win.mainloop()

It runs fine, but in Eclipse, I get the following two errors:

Undefined variable: Label line 3
Undefined variable: Tk line 2

Am I doing something to generate these errors? If not, is there a way to force Eclipse to re-evalu开发者_运维百科ate those lines correctly?


Because you import *. Eclipse hence don't know that Tk and Label is imported. Use from Tkinter import Tk, Label instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜