def admin(): raw = input('\n欢迎使用ATM后台管理系统\n1 账号查询\n2 账号解锁\n3 账号锁定\n4 账号注销\n5 退出\n请输入您要办理的业务: ').strip() #查询所有账户信息 if raw == '1': print('当前所有账号: \n') handle.select_all() log('查询当前所有账号') #解锁 elif raw == '2': choice = input('\n请输入您要解锁的卡号: ').strip() status = 0 handle.update_clock(choice,status) msg = '%s 已经解除限制.\n'% choice print(msg) log(i_name,msg) #锁定 elif raw == '3': choice = input('\n请输入您要锁定的卡号: ').strip() status = 1 handle.update_clock(choice,status) msg = '%s 已经锁定该账号.\n'% choice print(msg) log(i_name,msg) #注销 elif raw == '4': choice = input('请输入您要注销的账号: ').strip() handle.del_user(choice) msg = '%s 已经被注销!' % choice print(msg) log(i_name,msg) else: exit()
date = create_date() handle.log(name,date,event) #欢迎信息 def welcome(hello): res = hello.center(100,'*') return print(res) choice_list = [] choice_name_list = [] if __name__ == '__main__': welcome("欢迎登录网上商城,祝您购物愉快!") #循环展示商品,用户输入购买选项 while True: handle.select_all() user_choice = input('您要买什么: ').strip() if user_choice == '0': welcome('') print("\n您购买了如下商品: \n" ) #输入购买的商品 for i in choice_name_list: #print(i.rjust(20)) #本想右对齐,但是输出太不美观 print(i) #计算全部花费 cost = sum(choice_list) print('\n您此次共消费 %s 元.'%cost) #开始结算 #输入支付银行卡卡号和密码 #判断额度,也就是atm的转账功能 #一种结算方式,登录商城账号,结合卡号