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

Mariano Di Felice mardif
Gio 20 Gen 2005 14:01:44 CET


Topastro wrote:

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

il costruttore di wxFrame1 prende il parametro implicito self e un 
parent, tu gli passo solo il parametro implicito!

>
> + Type Error: __init__()takes exactly 2 arguments (1 given)
>
> Dove sbaglio?
>
>------------------------------------------------------------------------
>
>_______________________________________________
>La mailing list di python.it
>python a lists.python.it
>http://lists.python.it/cgi-bin/mailman/listinfo/python
>  
>


-- 
Se hai urgenza, puoi rispondere alla mia e-mail con un SMS gratuito!
http://www.areaprivati.190.it/190/trilogy/jsp/dispatcher.do?ty_key=rsms_invio_sms_pri&klink=6E2DD8940A016EF3006811DF52128EF2

/\/\ariano Di Felice
Java PHP Python programmer
with MySQL, PostgreSql, SQLite and Oracle support
Linux Platform Developer
mariano.difelice a eprometeus.com
www.eprometeus.com
Tel. 0735 656881
Fax. 0735 656307

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mardif.vcf
Type: text/x-vcard
Size: 376 bytes
Desc: not available
Url : http://pentesilea2/pipermail/python/attachments/20050119/3c6692fa/mardif.vcf


More information about the Python mailing list