Reputation: 11694
I tried the following example code from the tutorial that came along "wxPython2.8 Docs and Demos" package.
import wx
from frame import Frame
class App(wx.App):
"""Application class."""
def OnInit(self):
self.frame = Frame()
self.frame.Show()
self.SetTopWindow(self.frame)
return True
def main():
app = App()
app.MainLoop()
if __name__ == '__main__':
main()
but its giving me the following error
Traceback (most recent call last):
File "C:/Documents and Settings/umair.ahmed/Desktop/wxpy.py", line 3, in <module>
from frame import Frame
ImportError: No module named frame
kindly help i am just a newbie with python
Upvotes: 1
Views: 154
Reputation: 881635
Yeah, it's an ancient doc bug, see for example this 5-years-old post:-(. Fix:
from frame
import Frame
self.frame
= Frame()
to say instead self.frame = wx.Frame()
Upvotes: 0
Reputation: 375574
I think you should skip the "from frame import Frame" and change:
self.frame = Frame()
to:
self.frame = wx.Frame()
Upvotes: 1