from abc import ABCMeta, abstractmethod
# 接口:若干抽象方法的集合
class Paymet(metaclass=ABCMeta):
# abstractmethod class
# 抽象方法
@abstractmethod
def pay(self, money):
pass
class Aipay(Paymet): # 实现接口
def pay(self, money):
print("支付宝支付%d元" % money)
# 调用
p = Aipay()
p.pay(100)
标签:Paymet,abstractmethod,Python,money,接口,pay,class From: https://www.cnblogs.com/yeli-oneselfblogs/p/17082325.html