2007年11月24日 星期六 22:42
*code:* class test: x='this is test!' def __init__(self,y): self.x=y print self.x def go(self,a,y): num=int(a)+int(y) print num class gogo(test):pass ss=test('hello word') st=gogo() st.go(100,100) ÉÏÃæ³ÌÐògogo×ÓÀà¼Ì³ÐÌìtest¸¸Àà µ«ÊÇΪʲô»áÌáʾÎÒst=gogo()ÕâÀïÓдí TypeError: __init__() takes exactly 2 arguments (1 given) -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071124/39eca7d9/attachment.html
2007年11月25日 星期日 12:00
class gogo()ÖÐÓÐÒ»¸ö·½·¨__init__(self£¬y)¼Ì³Ð×ÔÀàtest¡£ ÒªÏëʹÓÃst=gogo()£¬ ±ØÐëÔÚgogoÀàÖж¨Òå×Ô¼ºµÄ__init__(self), ²¢ÏÔʽµ÷Óø¸ÀàµÄ__init__·½·¨¡£ ÔÚ07-11-24£¬Àé°Ê <nameliba在gmail.com> дµÀ£º > > *code:* > class test: > x='this is test!' > def __init__(self,y): > self.x=y > print self.x > > def go(self,a,y): > num=int(a)+int(y) > print num > > class gogo(test):pass > > ss=test('hello word') > st=gogo() > st.go(100,100) > > ÉÏÃæ³ÌÐògogo×ÓÀà¼Ì³ÐÌìtest¸¸Àà > > µ«ÊÇΪʲô»áÌáʾÎÒst=gogo()ÕâÀïÓдí > > TypeError: __init__() takes exactly 2 arguments (1 given) > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071125/05985408/attachment.html
2007年11月27日 星期二 01:25
PythonµÄ __init__º¯Êý²»ÄÜÏñ JAVA ¡¢ C++ÀïµÄ¹¹Ô캯ÊýÒ»ÑùÈ¥Àí½â¡£ Ëü²»»á×Ô¶¯µÄÈ¥µ÷ÓÃÆ丸ÀàµÄ__init__·½·¨¡£¶øÐèÒªÄãÈ¥ÏÔʽµØµ÷Óᣠ±ÈÈçÄãÕâÀïÓ¦¸Ã class gogo(test): def __init__(self): test.__init__(self, "some args") On Nov 24, 2007 10:42 PM, Àé°Ê <nameliba at gmail.com> wrote: > *code:* > class test: > x='this is test!' > def __init__(self,y): > self.x=y > print self.x > > def go(self,a,y): > num=int(a)+int(y) > print num > > class gogo(test):pass > > ss=test('hello word') > st=gogo() > st.go(100,100) > > ÉÏÃæ³ÌÐògogo×ÓÀà¼Ì³ÐÌìtest¸¸Àà > > µ«ÊÇΪʲô»áÌáʾÎÒst=gogo()ÕâÀïÓдí > > TypeError: __init__() takes exactly 2 arguments (1 given) > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- About Cyril.Liu ----------------------------------- Cyril ÊÇÒ»¸ö³ÌÐòÔ±, ÏÖÔÚÊǸöÇî¹âµ°, Ëû³£³£¸ú×Ô¼ºËµ:"ÎÒÕÒ»ÓÐÀíÏëþÎÅ£×Ð×Ð" -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20071127/b947d0dd/attachment.html
2007年11月27日 星期二 09:05
ÊDz»ÊÇÿ¸öclassÀàÒ»¶¨ÒªÓÐÒ»¸ö__init__ ÔÚ07-11-27£¬Cyril. Liu <terry6394在gmail.com> дµÀ£º > > PythonµÄ __init__º¯Êý²»ÄÜÏñ JAVA ¡¢ C++ÀïµÄ¹¹Ô캯ÊýÒ»ÑùÈ¥Àí½â¡£ > Ëü²»»á×Ô¶¯µÄÈ¥µ÷ÓÃÆ丸ÀàµÄ__init__·½·¨¡£¶øÐèÒªÄãÈ¥ÏÔʽµØµ÷Óᣠ> ±ÈÈçÄãÕâÀïÓ¦¸Ã > class gogo(test): > def __init__(self): > test.__init__(self, "some args") > > On Nov 24, 2007 10:42 PM, Àé°Ê <nameliba在gmail.com> wrote: > > > *code:* > > class test: > > x='this is test!' > > def __init__(self,y): > > self.x=y > > print self.x > > > > def go(self,a,y): > > num=int(a)+int(y) > > print num > > > > class gogo(test):pass > > > > ss=test('hello word') > > st=gogo() > > st.go(100,100) > > > > ÉÏÃæ³ÌÐògogo×ÓÀà¼Ì³ÐÌìtest¸¸Àà > > > > µ«ÊÇΪʲô»áÌáʾÎÒst=gogo()ÕâÀïÓдí > > > > TypeError: __init__() takes exactly 2 arguments (1 given) > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > -- > About Cyril.Liu > ----------------------------------- > Cyril > ÊÇÒ»¸ö³ÌÐòÔ±, > ÏÖÔÚÊǸöÇî¹âµ°, > Ëû³£³£¸ú×Ô¼ºËµ:"ÎÒÕÒ»ÓÐÀíÏëþÎÅ£×Ð×Ð" > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071127/81c23d54/attachment-0001.html
2007年11月28日 星期三 21:33
Õâ¸öµ¹²»Ò»¶¨. ÆäʵÕâ¸öÄã×Ô¼ºÊÔÊÔ²»¾Í¿ÉÒÔÁË?! ѧPython¾ÍÊÇÊÔ³öÀ´µÄ.. :D On Nov 27, 2007 9:05 AM, Àé°Ê <nameliba at gmail.com> wrote: > ÊDz»ÊÇÿ¸öclassÀàÒ»¶¨ÒªÓÐÒ»¸ö__init__ > > ÔÚ07-11-27£¬Cyril. Liu <terry6394 at gmail.com> дµÀ£º > > > PythonµÄ __init__º¯Êý²»ÄÜÏñ JAVA ¡¢ C++ÀïµÄ¹¹Ô캯ÊýÒ»ÑùÈ¥Àí½â¡£ > > Ëü²»»á×Ô¶¯µÄÈ¥µ÷ÓÃÆ丸ÀàµÄ__init__·½·¨¡£¶øÐèÒªÄãÈ¥ÏÔʽµØµ÷Óᣠ> > ±ÈÈçÄãÕâÀïÓ¦¸Ã > > class gogo(test): > > def __init__(self): > > test.__init__(self, "some args") > > > > On Nov 24, 2007 10:42 PM, Àé°Ê <nameliba at gmail.com> wrote: > > > > > *code:* > > > class test: > > > x='this is test!' > > > def __init__(self,y): > > > self.x=y > > > print self.x > > > > > > def go(self,a,y): > > > num=int(a)+int(y) > > > print num > > > > > > class gogo(test):pass > > > > > > ss=test('hello word') > > > st=gogo() > > > st.go(100,100) > > > > > > ÉÏÃæ³ÌÐògogo×ÓÀà¼Ì³ÐÌìtest¸¸Àà > > > > > > µ«ÊÇΪʲô»áÌáʾÎÒst=gogo()ÕâÀïÓдí > > > > > > TypeError: __init__() takes exactly 2 arguments (1 given) > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > -- > > About Cyril.Liu > > ----------------------------------- > > Cyril > > ÊÇÒ»¸ö³ÌÐòÔ±, > > ÏÖÔÚÊǸöÇî¹âµ°, > > Ëû³£³£¸ú×Ô¼ºËµ:"ÎÒÕÒ»ÓÐÀíÏëþÎÅ£×Ð×Ð" > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- About Cyril.Liu ----------------------------------- Cyril ÊÇÒ»¸ö³ÌÐòÔ±, ÏÖÔÚÊǸöÇî¹âµ°, Ëû³£³£¸ú×Ô¼ºËµ:"ÎÒÕÒ»ÓÐÀíÏëþÎÅ£×Ð×Ð" -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20071128/30ed2b22/attachment.html
2007年11月28日 星期三 21:42
¿´ÏÂÃæµÄ´úÂë:: >>> class test: def __init__(self): self.x = "Hello World!" def say(self): print self.x >>> a = test() >>> a.say() Hello World! >>> class test2(test): pass >>> b = test2() >>> b.say() Hello World! ÔÚ×ÓÀàûÓж¨Òå¹¹Ô캯Êý(__init__)µÄʱºò, »á×Ô¶¯µ÷Óø¸ÀàµÄ¹¹Ô캯Êý. ËùÒÔ, ÄãµÄ´úÂë³ö´íµÄÔÒòÊÇ...testÀàµÄ¹¹Ô캯ÊýÐèÒªÁ½¸ö²ÎÊý. ¶øÄãµÄ×ÓÀàÖ»ÌṩÁËÒ»¸ö.... ÔÚ07-11-28£¬Cyril. Liu <terry6394在gmail.com> дµÀ£º > > Õâ¸öµ¹²»Ò»¶¨. ÆäʵÕâ¸öÄã×Ô¼ºÊÔÊÔ²»¾Í¿ÉÒÔÁË?! > ѧPython¾ÍÊÇÊÔ³öÀ´µÄ.. :D > > On Nov 27, 2007 9:05 AM, Àé°Ê <nameliba在gmail.com> wrote: > > > ÊDz»ÊÇÿ¸öclassÀàÒ»¶¨ÒªÓÐÒ»¸ö__init__ > > > > ÔÚ07-11-27£¬Cyril. Liu <terry6394在gmail.com> дµÀ£º > > > > > PythonµÄ __init__º¯Êý²»ÄÜÏñ JAVA ¡¢ C++ÀïµÄ¹¹Ô캯ÊýÒ»ÑùÈ¥Àí½â¡£ > > > Ëü²»»á×Ô¶¯µÄÈ¥µ÷ÓÃÆ丸ÀàµÄ__init__·½·¨¡£¶øÐèÒªÄãÈ¥ÏÔʽµØµ÷Óᣠ> > > ±ÈÈçÄãÕâÀïÓ¦¸Ã > > > class gogo(test): > > > def __init__(self): > > > test.__init__(self, "some args") > > > > > > On Nov 24, 2007 10:42 PM, Àé°Ê <nameliba在gmail.com> wrote: > > > > > > > *code:* > > > > class test: > > > > x='this is test!' > > > > def __init__(self,y): > > > > self.x=y > > > > print self.x > > > > > > > > def go(self,a,y): > > > > num=int(a)+int(y) > > > > print num > > > > > > > > class gogo(test):pass > > > > > > > > ss=test('hello word') > > > > st=gogo() > > > > st.go(100,100) > > > > > > > > ÉÏÃæ³ÌÐògogo×ÓÀà¼Ì³ÐÌìtest¸¸Àà > > > > > > > > µ«ÊÇΪʲô»áÌáʾÎÒst=gogo()ÕâÀïÓдí > > > > > > > > TypeError: __init__() takes exactly 2 arguments (1 given) > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese在lists.python.cn > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > -- > > > About Cyril.Liu > > > ----------------------------------- > > > Cyril > > > ÊÇÒ»¸ö³ÌÐòÔ±, > > > ÏÖÔÚÊǸöÇî¹âµ°, > > > Ëû³£³£¸ú×Ô¼ºËµ:"ÎÒÕÒ»ÓÐÀíÏëþÎÅ£×Ð×Ð" > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > -- > About Cyril.Liu > ----------------------------------- > Cyril > ÊÇÒ»¸ö³ÌÐòÔ±, > ÏÖÔÚÊǸöÇî¹âµ°, > Ëû³£³£¸ú×Ô¼ºËµ:"ÎÒÕÒ»ÓÐÀíÏëþÎÅ£×Ð×Ð" > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- ¶«×Ó! ŬÁ¦×öºÃÿһ¼þÊÂ!!! -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071128/a63fd915/attachment.html
2007年11月28日 星期三 21:51
лл*¶«×Ó/hydon* ²âÊÔ¹ýÍêÈ«Á˽â!Õý½â ÔÚ07-11-28£¬¶«×Ó/hydon <hydonlee在gmail.com> дµÀ£º > > ¿´ÏÂÃæµÄ´úÂë:: > >>> class test: > def __init__(self): > self.x = "Hello World!" > def say(self): > print self.x > > > >>> a = test() > >>> a.say() > Hello World! > >>> class test2(test): pass > > >>> b = test2() > >>> b.say() > Hello World! > > ÔÚ×ÓÀàûÓж¨Òå¹¹Ô캯Êý(__init__)µÄʱºò, »á×Ô¶¯µ÷Óø¸ÀàµÄ¹¹Ô캯Êý. > > ËùÒÔ, ÄãµÄ´úÂë³ö´íµÄÔÒòÊÇ...testÀàµÄ¹¹Ô캯ÊýÐèÒªÁ½¸ö²ÎÊý. ¶øÄãµÄ×ÓÀàÖ»ÌṩÁËÒ»¸ö.... > > ÔÚ07-11-28£¬Cyril. Liu <terry6394在gmail.com> дµÀ£º > > > > Õâ¸öµ¹²»Ò»¶¨. ÆäʵÕâ¸öÄã×Ô¼ºÊÔÊÔ²»¾Í¿ÉÒÔÁË?! > > ѧPython¾ÍÊÇÊÔ³öÀ´µÄ.. :D > > > > > > On Nov 27, 2007 9:05 AM, Àé°Ê <nameliba在gmail.com> wrote: > > > > > ÊDz»ÊÇÿ¸öclassÀàÒ»¶¨ÒªÓÐÒ»¸ö__init__ > > > > > > ÔÚ07-11-27£¬Cyril. Liu <terry6394在gmail.com> дµÀ£º > > > > > > > PythonµÄ __init__º¯Êý²»ÄÜÏñ JAVA ¡¢ C++ÀïµÄ¹¹Ô캯ÊýÒ»ÑùÈ¥Àí½â¡£ > > > > Ëü²»»á×Ô¶¯µÄÈ¥µ÷ÓÃÆ丸ÀàµÄ__init__·½·¨¡£¶øÐèÒªÄãÈ¥ÏÔʽµØµ÷Óᣠ> > > > ±ÈÈçÄãÕâÀïÓ¦¸Ã > > > > class gogo(test): > > > > def __init__(self): > > > > test.__init__(self, "some args") > > > > > > > > On Nov 24, 2007 10:42 PM, Àé°Ê <nameliba在gmail.com> wrote: > > > > > > > > > *code:* > > > > > class test: > > > > > x='this is test!' > > > > > def __init__(self,y): > > > > > self.x=y > > > > > print self.x > > > > > > > > > > def go(self,a,y): > > > > > num=int(a)+int(y) > > > > > print num > > > > > > > > > > class gogo(test):pass > > > > > > > > > > ss=test('hello word') > > > > > st=gogo() > > > > > st.go(100,100) > > > > > > > > > > ÉÏÃæ³ÌÐògogo×ÓÀà¼Ì³ÐÌìtest¸¸Àà > > > > > > > > > > µ«ÊÇΪʲô»áÌáʾÎÒst=gogo()ÕâÀïÓдí > > > > > > > > > > TypeError: __init__() takes exactly 2 arguments (1 given) > > > > > > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese在lists.python.cn > > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > > > > > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > -- > > > > About Cyril.Liu > > > > ----------------------------------- > > > > Cyril > > > > ÊÇÒ»¸ö³ÌÐòÔ±, > > > > ÏÖÔÚÊǸöÇî¹âµ°, > > > > Ëû³£³£¸ú×Ô¼ºËµ:"ÎÒÕÒ»ÓÐÀíÏëþÎÅ£×Ð×Ð" > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese在lists.python.cn > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > -- > > About Cyril.Liu > > ----------------------------------- > > Cyril > > ÊÇÒ»¸ö³ÌÐòÔ±, > > ÏÖÔÚÊǸöÇî¹âµ°, > > Ëû³£³£¸ú×Ô¼ºËµ:"ÎÒÕÒ»ÓÐÀíÏëþÎÅ£×Ð×Ð" > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > -- > ¶«×Ó! > ŬÁ¦×öºÃÿһ¼þÊÂ!!! > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071128/57ed39f1/attachment.html
Zeuux © 2025
京ICP备05028076号