Python论坛  - 讨论区

标题:Re: RE: [python-chinese] hello me! __main__ 和self是何东东

2005年07月01日 星期五 09:17

Qutr qutianrang at gmail.com
Fri Jul 1 09:17:26 HKT 2005

jam.zheng,你好

其实粗略一点,你就可以把它看成是C++/java里的this。
Qutr , qutianrang at gmail.com 
2005-7-1 
----- 收到以下来信内容 ----- 
发件人: jam.zheng 
收件人: limodou,python-chinese 
时  间: 2005-07-01, 08:52:53
主  题: RE: [python-chinese] hello me! __main__ 和self是何东东


谢谢大侠指点:
    可是那个self我还是一头雾水,难道是c++里面的this指针吗?

-----Original Message-----
From: python-chinese-bounces at lists.python.cn
[mailto:python-chinese-bounces at lists.python.cn]On Behalf Of limodou
Sent: Thursday, June 30, 2005 7:05 PM
To: python-chinese at lists.python.cn
Subject: Re: [python-chinese] hello me! __main__ 和self是何东东


看我那个回复就行了。

2005/6/30, ella wang <ella at exoweb.net>:
> self 可以这么用
> class MyClass(FatherClass):
> def aa(self):
> ***
> bb_attr = ***
> self.bb(bb_attr)
> ***
> def bb(self, attr):
> ***
>
> __name__ 是模块中定义的变量,它定义该模块的名字.
> if __name__ == '__main__':
> 说明,你希望将给定的模块作为脚本运行
>
> 关于这点,我还不太明白,希望高手解释~
>
>
> On Thu, 2005-06-30 at 11:07 +0800, jam.zheng wrote:
> > 各位大侠:
> > __main__ -- Top-level script environment
> > This module represents the (otherwise anonymous) scope in which the
> > interpreter's main program executes -- commands read either from
standard
> > input, from a script file, or from an interactive prompt. It is this
> > environment in which the idiomatic ``conditional script'' stanza causes
a
> > script to run:
> > if __name__ == "__main__":
> > main()
> >
> > 能帮我解释一下吗?
> >
> > 还有那个很多源码上用的 self 是什么东东
> >
> > def __init__ (self, receiver, address):
> > asynchat.async_chat.__init__ (self)
> > self.receiver = receiver
> > self.set_terminator (None)
> > self.create_socket (socket.AF_INET, socket.SOCK_STREAM)
> > self.buffer = ''
> > self.set_terminator ('\n')
> > self.connect (address)
> >
> > _______________________________________________
> > python-chinese list
> > python-chinese at lists.python.cn
> > http://python.cn/mailman/listinfo/python-chinese
> >
>
> _______________________________________________
> python-chinese list
> python-chinese at lists.python.cn
> http://python.cn/mailman/listinfo/python-chinese
>


--
I like python!
My Donews Blog: http://www.donews.net/limodou
New Google Maillist: http://groups-beta.google.com/group/python-cn

_______________________________________________
python-chinese list
python-chinese at lists.python.cn
http://python.cn/mailman/listinfo/python-chinese
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20050701/c20c4049/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年07月01日 星期五 09:18

wang linda dingling528 at hotmail.com
Fri Jul 1 09:18:56 HKT 2005

有很多呀.你GOOGLE搜索一下就知道了.以下是我觉得比较好的一个连接.
http://www.byteofpython.info/language/chinese/index.html

>From: "Fan Hongtao" <fanhongtao at 163.com>
>Reply-To: python-chinese at lists.python.cn
>To: "python-chinese" <python-chinese at lists.python.cn>
>Subject: [python-chinese] wxPython 有没有中文的资料啊?/NULL
>Date: Fri, 1 Jul 2005 00:47:46 +0800
>
>python-chinese
>
>
>
>Best wishes!
>
>Fan Hongtao
>fanhongtao at 163.com
>2005-07-01
>
>
>_______________________________________________
>python-chinese list
>python-chinese at lists.python.cn
>http://python.cn/mailman/listinfo/python-chinese

_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。  http://www.hotmail.com  


[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年07月01日 星期五 10:26

limodou limodou at gmail.com
Fri Jul 1 10:26:19 HKT 2005

是wxPython而不是python.

在 05-7-1,wang linda<dingling528 at hotmail.com> 写道:
> 有很多呀.你GOOGLE搜索一下就知道了.以下是我觉得比较好的一个连接.
> http://www.byteofpython.info/language/chinese/index.html
> 
> >From: "Fan Hongtao" <fanhongtao at 163.com>
> >Reply-To: python-chinese at lists.python.cn
> >To: "python-chinese" <python-chinese at lists.python.cn>
> >Subject: [python-chinese] wxPython 有没有中文的资料啊?/NULL
> >Date: Fri, 1 Jul 2005 00:47:46 +0800
> >
> >python-chinese
> >
> >
> >
> >Best wishes!
> >
> >Fan Hongtao
> >fanhongtao at 163.com
> >2005-07-01
> >
> >
> >_______________________________________________
> >python-chinese list
> >python-chinese at lists.python.cn
> >http://python.cn/mailman/listinfo/python-chinese
> 
> _________________________________________________________________
> 享用世界上最大的电子邮件系统― MSN Hotmail。  http://www.hotmail.com
> 
> _______________________________________________
> python-chinese list
> python-chinese at lists.python.cn
> http://python.cn/mailman/listinfo/python-chinese
> 


-- 
I like python! 
My Donews Blog: http://www.donews.net/limodou
New Google Maillist: http://groups-beta.google.com/group/python-cn

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号