I want to use wxpython, but when I installed it python didn't recognise the module. I've looked everywhere for help but gotten nowhere so could someone help me out?
What operating system do you have?
Did you install proper version of wxPython?
I have Windows XP and my wx package is in
Here is a simple sample of wxPython code:
import wx class MyFrame(wx.Frame): def __init__(self): # create a frame/window, no parent, default to wxID_ANY wx.Frame.__init__(self, None, wx.ID_ANY, 'wxPython', pos=(300, 150), size=(300, 350)) self.SetBackgroundColour('green') # show the frame self.Show(True) application = wx.PySimpleApp() # call class MyFrame window = MyFrame() # start the event loop application.MainLoop()
The proper installation sequence is this way:
1) install the Python version for your operating system
2) install wxPython for your version of Python and OS
We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.