(在python2里)

1.属性

---数据属性

---函数属性

查看属性字典

class chinese:
rz:'huangzhong' print(chinese.__dict__)

运行结果:

{'__module__': '__main__', '__annotations__': {'rz': 'huangzhong'}, '__dict__': <attribute '__dict__' of 'chinese' objects>, '__weakref__': <attribute '__weakref__' of 'chinese' objects>, '__doc__': None}

Process finished with exit code 0

执行方法:

class chinese:
rz:'huangzhong'
def school():
print('') print(chinese.__dict__)
chinese.__dict__['school']()

运行结果:

{'__module__': '__main__', '__annotations__': {'rz': 'huangzhong'}, 'school': <function chinese.school at 0x7f5325d6cd90>, '__dict__': <attribute '__dict__' of 'chinese' objects>, '__weakref__': <attribute '__weakref__' of 'chinese' objects>, '__doc__': None}
333 Process finished with exit code 0

最新文章

  1. jQuery原生框架-----------------核心框架
  2. 在MVC5和webAPI下是用Autofac依赖注入
  3. 转:RabbitMQ基础知识
  4. 从零开始学ios开发(九):Swapping Views
  5. Linq知识小结
  6. JavaSE生成随机数
  7. Python新手学习基础之数据结构-列表2 添加
  8. Mysql学习(慕课学习笔记2)数据库的创建与删除
  9. 推荐五个最好的MySQL GUI工具
  10. SSM框架通过mybatis-generator自动生成代码
  11. Django学习日记07_Admin
  12. XML解析的四种方法 建议使用demo4j解析 测试可以用
  13. Java实现inputstream流的复制
  14. 【深度好文】多线程之WaitHandle--&gt;派生EventWaitHandle事件构造-》AutoResetEvent、ManualResetEvent
  15. js 关于定时器的知识点。
  16. python之斐波那契数列递归推导在性能方面的反思
  17. JAVA框架:hibernate(二)
  18. sort命令的使用,结合uniq, awk等
  19. Material Design系列第一篇——Creating Apps with Material Design
  20. Java原子性、可见性、内存模型

热门文章

  1. JAVA常用处理数据
  2. git的搭建和使用
  3. 1-开发共享版APP(接入指南)-APP说明
  4. (LIS)最长上升序列(DP+二分优化)
  5. LOJ572. 「LibreOJ Round #11」Misaka Network 与求和 [莫比乌斯反演,杜教筛,min_25筛]
  6. 公司不用 Spring Boot,果断离职了!
  7. Cesium学习笔记-工具篇20-PrimitiveTexture自定义渲染-贴图【转】
  8. phpstudy apache 服务无法启动
  9. PostgreSQL--with子句
  10. RAID技术全解图解-RAID0、RAID1、RAID5、RAID100【转】