import os,sys base_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))sys.path.append(base_dir)print (sys.path) print( ‘ICBC Bank‘.center( 30,‘-‘),‘\n‘ ‘1.账户信息‘‘\n‘ ‘2.转账‘)alex_money = {‘user‘:‘alex‘,}def choice(num): if num == ‘1‘: f = open(‘../account/alex.json‘,‘r‘) print (type(f.read())) elif num == ‘2‘: f = open(‘../account/alex.json‘,‘r‘) f2 = open(‘../account/tesla_company.json‘,‘r‘) alex_act = int(float(f.read().strip()))-950000*(1+0.05) tesla_act = int(float(f2.read().strip()))+950000*(1+0.05) f.close() f2.close() f = open(‘../account/alex.json‘,‘w‘) f2 = open(‘../account/tesla_company.json‘,‘w‘) f.write(str(int(alex_act))) f2.write(str(int(tesla_act))) choice1 = input(‘选择服务:‘)choice(choice1)
原文地址:https://www.cnblogs.com/fxm12138/p/12115479.html
时间: 2024-10-13 18:44:14