博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[Python]Python Class 中的 函数定义中的 self
阅读量:7122 次
发布时间:2019-06-28

本文共 325 字,大约阅读时间需要 1 分钟。

In [80]: class MyClass001:

....: def selfDemo(self):

....: print 'My Demo'
....:

In [81]: p = MyClass001()

In [82]: p.selfDemo()

My Demo

In [83]:

In [83]: class MyClass002:

....: def selfDemo(self):
....: print self
....:

In [84]: p=MyClass002()

In [85]: p.selfDemo()

<__main__.MyClass002 instance at 0x7f308a0394d0>

In [86]:

转载地址:http://bwael.baihongyu.com/

你可能感兴趣的文章
安装CentOS 6.5时出现detecting hardware然后就停止不动解决
查看>>
Linux自学笔记——nsswitch and pam
查看>>
mysql 启动失败 和 php路径错误 以及 php 无法显示的问题
查看>>
[深入理解文件系统之八]SVR4中的Page Cache
查看>>
AGG第三十课 image transformations位图转换
查看>>
路由器的配置及其功能
查看>>
linux|权限修改chmod和chown
查看>>
Caffe:深入分析(怎么训练)
查看>>
再次深入到ip_conntrack的conntrack full问题
查看>>
linux如何使用find命令查找文件
查看>>
SQL Server 2012 创建数据库快照
查看>>
DNS子域的授权
查看>>
C++鲜为人知的符号
查看>>
隐式游标返回结果
查看>>
继续蹂躏linux
查看>>
Windows Phone 7中的Tombstoning
查看>>
python读写csv文件的实战
查看>>
“开源”创造者为你论述这一术语的前世今生
查看>>
BeanShell脚本接口之this引用接口类型
查看>>
Python安装setuptools遇到的MARKER_EXPR错误
查看>>