# encoding: utf-8
import arcpy
class person():
def __init__(self,name,age):
self.name=name
self.age=age
def getAge(self):
print self.age
p1=person("lyp",23)
p1.getAge()
其中__init__方法会在实例化时自动调用。类似于静态语言中的构造函数吧.
其他常见规范见 PEP8规范