Undefined variable from import when using wxPython in pydev
Posted
by Bibendum
on Stack Overflow
See other posts from Stack Overflow
or by Bibendum
Published on 2010-01-26T23:40:20Z
Indexed on
2010/03/19
9:51 UTC
Read the original article
Hit count: 610
I just downloaded wxPython, and was running some of the sample programs from here. However, on every line that uses a variable from wx.*, I get a "Undefined variable from import error"
For example, the following program generates five errors on lines 1,4,8, and two on line 5:
import wx
class MyFrame(wx.Frame):
""" We simply derive a new class of Frame. """
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, title=title, size=(200,100))
self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE)
self.Show(True)
app = wx.App(False)
frame = MyFrame(None, 'Small editor')
app.MainLoop()
The program, however, compiles and runs perfectly. I haven't made any significant modifications to pydev or eclipse, and the wxPython install is fresh.
© Stack Overflow or respective owner