Reputation: 5851
I'm new to wxpython, i just installed in on my ubuntu 13.04 by the following command :
sudo apt-get install python-wxgtk2.8
My system says its installed properly but when I'm trying to run an simple application :
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, "My Frame", size=(300, 300))
panel = wx.Panel(self, -1)
panel.Bind(wx.EVT_MOTION, self.OnMove)
wx.StaticText(panel, -1, "Pos:", pos=(10, 12))
self.posCtrl = wx.TextCtrl(panel, -1, "", pos=(40, 10))
def OnMove(self, event):
pos = event.GetPosition()
self.posCtrl.SetValue("%s, %s" % (pos.x, pos.y))
if __name__ == '__main__':
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show(True)
app.MainLoop()
Im getting error : Traceback (most recent call last): File ".path./wxTest.py", line 2, in class MyFrame(wx.Frame): AttributeError: 'module' object has no attribute 'Frame'
Please help me with this, Thanks
Upvotes: 2
Views: 272
Reputation: 5851
Got it fixed,
I installed also using pip install which installed some other package name with the wx and i uninstalled wx from pip and then again installed using apt-get install, now its working please use it an help.
Thanks
Upvotes: 1