Why is Pydev in Eclipse claiming errors on a working program? [duplicate]
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.
精彩评论