安裝pydev
+ eclips
1.安裝java-jdk
2.設定環境變數,用cmd-java看是否安裝成功
3.下載Eclipse
IDE for C/C++ Developers
class
DerivedClassName(BaseClassName):
<statement-1>
.
.
.
<statement-N>
|
class
Father:
def
__init__(self,f_name,f_age):
self.f_name
= f_name
self.f_age
= f_age
def
f_info(self):
print("papa
name:",self.f_name,"papa age:",self.f_age)
class
Child(Father):
def
__init__(self,c_name,c_age,f_name,f_age):
Father.__init__(self,f_name,f_age)
self.c_name
= c_name
self.c_age
= c_age
self.f_info()
def
fam_info(self):
print("age
sum:",self.f_age+self.c_age)
|
class
Father(object):
def
__init__(self,f_name,f_age):
self.f_name
= f_name
self.f_age
= f_age
def
f_info(self):
print("papa
name:",self.f_name,"papa age:",self.f_age)
class
Child(Father):
def
__init__(self,c_name,c_age,f_name,f_age):
super(Child,self).__init__(f_name,f_age)
self.c_name
= c_name
self.c_age
= c_age
self.f_info()
def
fam_info(self):
print("age
sum:",self.f_age+self.c_age)
|
class
Father:
def __init__(self,f_name,f_age):
self.f_name = f_name
self.f_age = f_age
def f_info(self):
print("papa name:",self.f_name,"papa
age:",self.f_age)
class
Mother:
def __init__(self,m_name,m_age):
self.m_name = m_name
self.m_age = m_age
def m_info(self):
print("mama name:",self.m_name,"mama
age:",self.m_age)
class
Child(Father,Mother):
def
__init__(self,c_name,c_age,f_name,f_age,m_name,m_age):
Father.__init__(self,f_name,f_age)
Mother.__init__(self,m_name,m_age)
self.c_name = c_name
self.c_age = c_age
self.f_info()
self.m_info()
def fam_info(self):
print("age
sum:",self.f_age+self.m_age+self.c_age)
|
class
Mother(object):
def
__init__(self,m_name,m_age):
self.m_name
= m_name
self.m_age
= m_age
def
m_info(self):
print("mama
name:",self.m_name,"mama age:",self.m_age)
class
Father(Mother):
def
__init__(self,f_name,f_age,m_name,m_age):
super(Father,self).__init__(m_name,m_age)
self.f_name
= f_name
self.f_age
= f_age
def
f_info(self):
print("papa
name:",self.f_name,"papa age:",self.f_age)
class
Child(Father,Mother):
def
__init__(self,c_name,c_age,f_name,f_age,m_name,m_age):
super(Child,self).__init__(f_name,f_age,m_name,m_age)
self.c_name
= c_name
self.c_age
= c_age
self.f_info()
self.m_info()
def
fam_info(self):
print("age
sum:",self.f_age+self.m_age+self.c_age)
|
class
A(object):
def
__init__(self):
super(A,self).__init__()
print
"A"
class B(A):
def
__init__(self):
super(B,self).__init__()
print
"B"
class C(A):
def
__init__(self):
super(C,self).__init__()
print
"C"
class
D(object):
def
__init__(self):
super(D,self).__init__()
print
"D"
class
E(B,C,D):
def
__init__(self):
super(E,self).__init__()
print
"E"
|
class
A(object):
def
__init__(self):
print
"A"
class B(A):
def
__init__(self):
print
"B"
class C(A):
def
__init__(self):
print
"C"
class
D(object):
def
__init__(self):
print
"D"
class
E(B,C,A,D):
def
__init__(self):
D.__init__(self)
A.__init__(self)
C.__init__(self)
B.__init__(self)
print
"E"
|