[PIPython] Stò impazzendo: Type Error: __init__()takes exactly 2 arguments (1 given)

Topastro topomorto
Mer 19 Gen 2005 12:50:42 CET


Scusate... sono nuovo in python.
Qulacuno può aiutarmi?

# apptest.py

#!/usr/bin/env python
#Boa:App:BoaApp

from wxPython.wx import *

import frametest1

modules ={u'frametest1': [1, 'Main frame of Application', u'frametest1.py']}

class BoaApp(wxApp):
    def OnInit(self):
        wxInitAllImageHandlers()
        self.main = frametest1.create(None)
        self.main.Show()
        self.SetTopWindow(self.main)
        return True

def main():
    application = BoaApp(0)
    application.MainLoop()

if __name__ == '__main__':
    main()
    
# frametest1.py
#Boa:Frame:wxFrame1

from wxPython.wx import *
from wxPython.lib.stattext import wxGenStaticText

def create(parent):
    return wxFrame1(parent)

[wxID_WXFRAME1, wxID_WXFRAME1TESTO1,
] = map(lambda _init_ctrls: wxNewId(), range(2))

class wxFrame1(wxFrame):
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wxFrame.__init__(self, id=wxID_WXFRAME1, name='', parent=prnt,
              pos=wxPoint(251, 183), size=wxSize(768, 527),
              style=wxDEFAULT_FRAME_STYLE, title='wxFrame1')
        self.SetClientSize(wxSize(760, 493))

        self.testo1 = wxGenStaticText(ID=wxID_WXFRAME1TESTO1,
              label=u'test testo', name=u'testo1', parent=self, 
pos=wxPoint(0,
              0), size=wxSize(760, 493), style=0)

    def __init__(self, parent):
        self._init_ctrls(parent)

        
miotest1 = wxFrame1()

+ Type Error: __init__()takes exactly 2 arguments (1 given)

Dove sbaglio?


More information about the Python mailing list