先建立项目目录: mystevedore
然后新建一个目录: people,该目录
下面分别包含:
__init__.py
chinese.py
english.py
pluginBase.py
文件
__init__.py 文件内容为空
pluginBase.py文件内容如下
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class PeopleBase(object):
def __init__(self):
pass
@abc.abstractmethod
def say(self):
chinese.py文件内容如下
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pluginBase import PeopleBase
class Chinese(PeopleBase):
def say(self):
return "ni hao"
english.py文件内容如下
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pluginBase import PeopleBase
class Chinese(PeopleBase):
def say(self):
return "he