Joseph Quigley wrote: > Hi, > what's the **kw stand for, used for? What does it mean? > >
[...] >> >>class Main(Frame): >> def __init__(self, master=None, **kw): >> Frame.__init__(self, master, **kw) >> It is the python way to pass along all keyword arguments (xxx=yyy). So in the above if Main was instantiated the following way: myframe = Main(name="some name", height="100") Then __init__ gets called with parameters: __init__(self,None, name="some name", height="100") The **kw here denotes the name and height keywords. Therefore Frame.__init__ is called with: __init__(self,None, name="some name", height="100") Without **kw, there is no other way to send an arbitary number of parameters to Frame.__init__. - Sandip -- Sandip Bhattacharya * Puroga Technologies * [EMAIL PROTECTED] Work: http://www.puroga.com * Home/Blog: http://www.sandipb.net/blog PGP/GPG Signature: 51A4 6C57 4BC6 8C82 6A65 AE78 B1A1 2280 A129 0FF3 _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor