继承:单继承,多继承

方法:self开头,类似C#中的this

属性:直接写变量

对象:使用类名() 构造

__init__():构造函数

#多继承

class A(object):

.............

class B(object):

.............

class C(A,B):

class RcdBase(object):

  recordID = "" #类属性

  def __init__(self):

    print 'call Rcd Base __init__'

  

  def getRecordID(self):

    return self.recordID   #对象属性,已self来调用

class RcdHeader(RcdBase):

  def __init__(self):

    print 'call RcdHeader __init__'

    return super(RcdHeader, self).__init__()

  CreateDate = ""

  CreateTime ="2015-8-6"

  SoftwareName = "imc"

header = RcdHeader()

print header.CreateTime

print header.SoftwareName

所有的非类的写法都是字面量

list的字面量是[]

__add__实际上是运算符重载的内部结构

list的方法

print dir(list)

#print help(list)

nl = [1,3,5,7]

nl.append('pz')

print nl.append(3),nl

print nl.count(3)

print nl.index('pz')

print nl.insert(0,12), nl

print nl.pop(2)

print nl,nl.pop()

print nl.reverse(),nl

print nl.sort(),nl

print [1,2,3] + [5,6,9]

最新文章

  1. Maven pom文件常用配置,转载
  2. LUA table学习笔记
  3. [译]git rebase
  4. 转-Spring 注解学习手札(七) 补遗——@ResponseBody,@RequestBody,@PathVariable
  5. JavaScript高级 面向对象的程序设计 (一)《JavaScript高级程序设计(第三版)》
  6. DataGridView导出Excel
  7. 第二十九篇、UICollectionView瀑布流
  8. UVA 10896 Sending Email
  9. 允许debian wheezy支持IOS7+的iphone.
  10. C#中的逆变和协变
  11. Hibernate学习(一)创建数据表
  12. 个性化WinPE封装方法----制作过程需要了解的“命令”
  13. TRIO-basic指令--函数FUNCTION
  14. Codeforces Round #542 [Alex Lopashev Thanks-Round] (Div. 2) A - D2
  15. spark streaming的有状态例子
  16. Java编程的逻辑 (76) - 并发容器 - 各种队列
  17. HTML5练习3
  18. 硬盘 不属于Rom RAM
  19. jQuery开发技巧
  20. BIEE11G配置Oracle 12c数据源

热门文章

  1. Android 毛玻璃效果
  2. MyString(重写String)
  3. postgresql集群方案参考答案
  4. 如何使用Case进行简单判断
  5. DC/DC与LDO的差别
  6. 解析PHP处理换行符的问题 \r\n
  7. 【JAVA反射机制】
  8. 攻城狮在路上(叁)Linux(二十五)--- linux内存交换空间(swap)的构建
  9. annotation-config 和 component-scan 的区别
  10. C# 创建Windows Service