[Chicago] python and c import error

Robert Ramsdell rcriii at ramsdells.net
Tue Nov 14 14:33:04 CET 2006


Does your python script work before you try importing it into the C
extension?  When I try it it does not work.  However, my last version
did not work either, the following does (I forgot to define mainloop):

import wx
class MyApp(wx.Frame):
    def __init__(self,title = "MyApp"):
        self.app = wx.PySimpleApp()
        self.title = title
        self.windowCaption = title
        wx.Frame.__init__(self,None,wx.ID_ANY, self.windowCaption,
                          size=(200,100),
                          style=wx.DEFAULT_FRAME_STYLE|
wx.NO_FULL_REPAINT_ON_RESIZE)
        self.Show(True)
        
    # These functions run the app
    def mainloop(self):
        self.app.MainLoop()
                          
if __name__ == "__main__":
    newapp = MyApp()
    newapp.mainloop()

However, I'm not at all sure how this will play with the c extension,
I'm afraid that's over my head.

Robert

On Tue, 2006-11-14 at 20:36 +0800, Jolley wrote:
> here is a script which shows the creation  of a frame.
> with its name app.py
> import wx
> class MyApp(wx.App):
>          def OnInit(self,title = "MyApp"):
>                self.app = wx.PySimpleApp()
>                self.title = title
>                self.windowCaption = title
> 
> wx.Frame.__init__(self,None,self.ID_ANY,self.windowCaption,
>                                           size = (200,100),
>                                           style =
> wx.DEFAULT_WINDOW_STYLE|
>                                        wx.NO_FULL_REPAINT_NO_RESIZE)
> app = MyApp(0)
> app.MainLoop()
> hmm,the python script is povided by Robert ,thanks again for the
> valuable revision on my former script,it's ugly and not smart.
> and then when i intend to use it in c extension.so,i start by

> 



More information about the Chicago mailing list