0

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?

3
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by vegaseat
0

What operating system do you have?
Did you install proper version of wxPython?

I have Windows XP and my wx package is in
C:\Python24\Lib\site-packages\wx-2.6-msw-unicode\wx\__init__.py

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()
0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.