-
Notifications
You must be signed in to change notification settings - Fork 0
SW 구조 설계_Python
실외 무인 경비 로봇 edited this page Jun 12, 2019
·
3 revisions
import abc
class 추상클래스명(metaclass=abc.ABCMeta):
@abc.abstractmethod
def 추상메소드(self):
pass
import abc # Abstract Base Class
class AbstractClass(metaclass=abc.ABCMeta):
def __init__(self):
pass
@abc.abstractmethod
def operation(self):
pass
def template_method(self):
self.operation()
class ConcreteClass(AbstractClass):
def __init__(self):
pass
def operation(self):
print("operation")
# ---------------------------------------------
a = ConcreteClass()
a.template_method()