class s_all(metaclass=abc.ABCMeta): #python2.7用此方法定义接口继承 # __metaclass__ = abc.ABCMeta @abc.abstractmethod def read(self): pass
pyhton2.7会报错,此方法用于python3+
pyhton2.7应用次方法定义
class s_all(): #python2.7用此方法定义接口继承 __metaclass__ = abc.ABCMeta @abc.abstractmethod def read(self): pass