码迷,mamicode.com
首页 > 其他好文 > 详细

atm-interface-shopping

时间:2018-06-24 21:38:57      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:size   16px   else   cos   sele   print   sel   from   opp   

from db import db_handler
from interface import bank

def shopping_interface(name, cost, shoppingcart):
flag,msg = bank.consume_interface(name,cost)
if flag:
dic = db_handler.select(name)
dic[‘shoppingcart‘] = shoppingcart
db_handler.save(dic)
return True, ‘购买成功‘
else:
print(msg)


def check_shoppingcart(name):
dic = db_handler.select(name)
return dic[‘shoppingcart‘]

atm-interface-shopping

标签:size   16px   else   cos   sele   print   sel   from   opp   

原文地址:https://www.cnblogs.com/wangcheng9418/p/9221766.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!