python模拟ATM + 购物商城
模擬實現一個ATM + 購物商城程序
- 額度 15000或自定義
- 實現購物商城,買東西加入 購物車,調用信用卡接口結賬
- 可以提現,手續費5%
- 每月22號出賬單,每月10號為還款日,過期未還,按欠款總額 萬分之5 每日計息
- 支持多賬戶登錄
- 支持賬戶間轉賬
- 記錄每月日常消費流水
- 提供還款接口
- ATM記錄操作日志
- 提供管理接口,包括添加賬戶、用戶額度,凍結賬戶等。。。
- 用戶認證用裝飾器
51cto在編輯python代碼的時候非常的垃圾,python當中有多行注釋符號,“ '''''' ”,但是跟它這里的這個什么代碼高亮沖突,垃圾、垃圾啊!!!!這還是一個技術網站呢,垃圾!
程序說明:程序code
readme.md
## ATM信用卡購物模擬程序### 作者介紹: * author:hgz ### 博客地址: * https://blog.51cto.com/11019859/2060110### 功能介紹: 模擬實現一個ATM + 購物商城程序 額度 15000或自定義 實現購物商城,買東西加入 購物車,調用信用卡接口結賬 可以提現,手續費5% 支持多賬戶登錄 支持賬戶間轉賬 記錄每月日常消費流水 提供還款接口 ATM記錄操作日志 提供管理接口,包括添加賬戶、用戶額度,凍結賬戶等。。。 用戶認證用裝飾器### 目錄結構:Day5├── ATM-CreditCard├── README.md├── core #入口程序目錄│ └── main.py #入口程序(啟動程序)├── conf #配置文件目錄│ └── setting.py├── modules #程序核心目錄│ ├── admincenter.py #管理模塊│ ├── authentication.py #認證模塊│?? ├── common.py # 日志模塊│ ├── creditcard.py #信用卡模塊│ ├── shopping.py #購物模塊├── database #程序數據庫│ ├── creditcard_dict #信用卡數據庫│ ├── creditcard_record #信用卡流水記錄數據庫│ ├── details_tip #提示信息│ ├── product_list #商城產品數據庫│ └── shopping_car #購物車數據庫│ ├── shopping_record #購物記錄│ └── users_dict #用戶數據庫└── log└── log #待擴展....### 運行說明:* 用戶、信用卡信息數據庫已經建立好------用戶:hgz 密碼:123------信用卡:888888 密碼:123------信用卡:666666 密碼:123------管理中心用戶:admin 密碼:admin* 目錄結構保持一致,開始啟動mian.py一、主程序ATM-CreditCard開始1、把admincenter,shopping,authentication,creditcard目錄加載到系統2、進入購物模擬程序,選擇相應的模式3、循環菜單(1)、輸入1,加載authentication.user_auth()進行系統賬號認證,然后調用模塊shopping,進入商城購物(2)、輸入2,加載authentication.creditcard_auth()進行信用卡認證,認證通過后調用creditcard模塊,信用卡操作(3)、輸入3,加載authentication.admincenter_auth()進行信用卡認證,認證通過后調用admincenter模塊,管理操作(4)、輸入q, 程序終止,退出程序4、菜單1:shopping商城(1)、加載user_auth()函數進行用戶認證,用戶認證通過后進行購物中心(2)、輸入值為1,加載shopping.shopping_mall()函數,進行商品選購,選購的商品會加入到購物車,結束購物按b返回(3)、輸入值為2,加載shopping.shopping_car()函數,查看當前用戶的購物車數據庫數據庫,之前購物商場里選擇的商品,會在此顯示,如果沒進行購物,會顯示為空,另當購物結算完成后,購物車會清空,商品記錄到消費記錄,按b返回,按f清空(4)、輸入值為3,加載 shopping.pay_shopping(current_user)函數,詢問是否要進行結賬,對購物車商品進行購買;選擇結算操作,系統會加載賬號是否綁定了信用卡,如果未綁定,會提示需到個人中心綁定才能結算;如果進行了綁定,加載auth_creditcard(creditcard)函數進行信用卡密碼認證;認證成功加載shoppingcar_record(current_user,list)、creditcard_record(creditcard, value)、empty_shopping_car()函數進行信用卡流水,用戶消費流水,購物車清空操作(5)、輸入值為4,進入個人中心設置,進入循環菜單:①、輸入1,加載shopping.catcar_record(current_user)函數,進行當前用戶的購物歷史記錄查看,無購物則為空,購物記錄用時間進行分割進行顯示,按b返回②、輸入2,加載shopping.updata_password(current_user)函數,選擇是否對密碼修改,輸入y,輸入賬號原來的密碼,匹配成功,輸入新的密碼,再次輸入新的密碼,兩次密碼匹配成功,修改成功,否則修改失敗;按b返回③、輸入3,加載shopping.updata_address(current_user)函數,選擇是否對收貨地址進行修改,輸入y,輸入新的地址,保存默認地址為none,按b返回④、輸入4,加載shopping.link_creditcard(current_user)函數,選擇是否進行信用卡綁定,默認為為綁定;選擇y,輸入信用卡卡號,加載信用卡數據庫進行匹配,如果信用卡存在綁定成功,否則失敗,按b返回⑤、輸入b,返回上一級(6)、輸入值為b,返回上一級菜單5、菜單2:信用卡中心(1)、加載creditcard_auth()函數進行信用卡認證,認證通過后進入信用卡中心(2)、輸入值為1,加載creditcard.my_creditcard(current_creditcard)函數,查看當前信用卡卡號、額度、提現額度、持卡人,按b返回(3)、輸入值為2,加載creditcard.cash_advance(current_creditcard)函數,進行現金提現,顯示卡號、額度、可提現金額,還有取現具體計算方式,輸入提現的金額,不能大于可提現金額,也不可大于額度金額;提現成功,按b返回;提現是調用creditcard_record(current_creditcard, record)函數,進行信用卡流水記錄(4)、輸入值為3,加載creditcard.Transfer(current_creditcard)函數,進入轉賬選項,選擇確定轉賬;輸入轉賬對方的賬號,再次輸入轉賬對方賬號,兩次一致;輸入轉賬金額,不大于當前額度,全部通過,轉賬成功;然后調用creditcard_record(current_creditcard, record)函數進行流水記錄,否則提示轉賬失敗,按b返回(5)、輸入值為4,加載creditcard.repayment(current_creditcard))函數,對當前信用卡進行還款,輸入正確的金額數字,還款成功,調用creditcard_record(current_creditcard, record)進行流水記錄,否則還款失敗,按b返回(6)、輸入值為5,加載creditcard.catcard_record(current_creditcard)函數,打印當前信用卡賬戶流水賬的日期,輸入要查看的流水日期匹配后打印日期當天的所有流水記錄(按照時間的先后順序),否則打印失敗,重新輸入,按b返回;沒有進行過交易的卡號為空(7)、輸入值為b,返回上一級菜單6、菜單3:管理中心(1)、加載admincenter_auth()函數進行管理認證,認證通過后進入管理中心,顯示管理菜單(2)、輸入值為1,加載admincenter.user_create()函數,打印當前已有賬號,開始進行系統賬號創建,詢問是否進程新用戶創建;選擇y,開始創建用戶輸入要創建的用戶名,輸入密碼,如果創建的用戶不存在,新建用戶創建成功;否則失敗,另輸入的用戶名不能為空,按b返回;打印當前最新用戶列表(3)、輸入值為2,加載 admincenter.lock_user()函數,打印當前用戶列表,以及當前的鎖定狀態;輸入要鎖定的用戶名,對已有的賬號進行鎖定,輸入的賬號不存在,鎖定失敗;輸入的賬號存在,但是當前已經被鎖定,鎖定失敗;賬號存在,未被鎖定,顯示鎖定成功;打印當前所有用戶的鎖定狀態,鎖定高亮顯示,被鎖定的用戶不能進行系統登錄。按b返回(4)、輸入值為3,加載 admincenter.unlock_user()函數,打印當前用戶列表,以及當前的鎖定狀態;輸入要解鎖的用戶名,對已有的賬號進行解鎖,輸入的賬號不存在,解鎖失敗;輸入的賬號存在,但是當前未被被鎖定,解鎖失敗;賬號存在,之前被鎖定,顯示解鎖成功;打印當前所有用戶的鎖定狀態,鎖定高亮顯示,被鎖定的用戶不能進行系統登錄。按b返回(5)、輸入值為4,加載admincenter.creditcard_create()函數,打印當前已有信用卡,開始進行系統信用卡發行,詢問是否進程信用卡創建;選擇y,開始發行信用卡輸入要創建的信用卡卡號,輸入密碼,如果創建的信用卡不存在,新建信用卡發行成功;否則失敗,另輸入的信用卡必須為6位數數字,不能重合,發行過的信用卡不能在此進行發;按b返回,打印當前最新信用卡列表(6)、輸入值為5,加載admincenter.lock_creditcard())函數,打印當前信用卡列表,以及當前的凍結狀態;輸入要凍結的信用卡卡號,對已有的信用卡進行凍結輸入的信用卡卡號不存在,凍結失敗;輸入的信用卡卡號存在,但是當前已經被凍結,凍結失敗;賬號存在,未被凍結,顯示凍結成功;打印當前所有信用卡卡號的凍結狀態,被凍結的卡號高亮顯示,被凍結的用戶不能進行信用卡登錄,不能進行購物消費。按b返回(7)、輸入值為6,加載admincenter.unlock_creditcard())函數,打印當前信用卡列表,以及當前的凍結狀態;輸入要解凍的信用卡卡號,對已有的信用卡進行解凍輸入的信用卡卡號不存在,解凍失敗;輸入的信用卡卡號存在,但是當前未被凍結,解凍失敗;賬號存在,已經被凍結,顯示解凍成功;打印當前所有信用卡卡號的凍結狀態,被凍結的卡號高亮顯示,被凍結的用戶不能進行信用卡登錄,不能進行購物消費。按b返回(8)、輸入值為7,加載admincenter.updata_limit()函數,打印當前信用卡賬戶賬號,目前可用額度,取現額度,選擇是否進行額度調整;選擇y,進行額度調整,輸入要調整額度的信用卡卡號,6為數字,如果輸入的信用卡不存在,提示錯誤;輸入已有的信用卡開號,輸入新的額度(5000以上),顯示額度調整成功,再此打印最新的信用卡賬戶賬號,目前可用額度,取現額度列表;按b返回(9)、輸入值為b,返回上一級菜單7 關于信用卡額度,取現額度,可以取現額度:①信用卡默認取現額度為信用卡額度的50%(此系統默認取現額度為7500)②信用卡進行消費時(未取現),取現額度不會變化③信用卡額度低于取現額度時,可取現金額以當前額度為準(可取現金額=當前額度*0.95)④取現額度只有兩種狀況會發生變化,一種進行取現,第二是對信用卡額度進行調整⑤每次取現扣除5%的手續費總結:信用卡額度為總共可消費額度,取現額度為理論上可取現額度,可取現額度為當前真正可以取現的額度(會出現信用卡額度低于取現額度的可能此時已信用卡額度為準,另有手續費要加收,所以當前的額度不能全部取完,要扣除5%的手續費,此時可取現額度為額度的95%)流程圖:
1、主程序core目錄下的main.py
#!/usr/bin/python #_*_coding:utf-8_*_import os,sysBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(BASE_DIR)from modules import admincenter,authentication,creditcard,shoppingwhile True:print("\33[35;1m歡迎進入信用卡購物模擬程序\33[0m".center(50, "#"),"\n1 購物中心\n""2 信用卡中心\n""3 后臺管理\n""q 退出程序\n")choice_id = input('\33[34;0m選擇要進入模式的ID\33[0m: ').strip()if choice_id == "1":res = authentication.user_auth()if res != None :if res[0] == "True":current_user = res[1]shopping.empty_shopping_car()while True:print("\33[36;1m歡迎進入購物中心\33[0m".center(50,"*"),"\n1 購物商場\n""2 查看購物車\n""3 購物結算\n""4 個人中心\n""b 返回\n")choice_id = input("\33[34;0m選擇要進入模式的ID\33[0m:")if choice_id == "1":shopping.shopping_mall()elif choice_id == "2":shopping.shopping_car()elif choice_id == "3":shopping.pay_shopping(current_user)elif choice_id == "4":while True:print("\33[33;1m個人中心\33[0m".center(50, "*"),"\n1 購物歷史記錄\n""2 修改登錄密碼\n""3 修改個人信息\n""4 修改行用卡綁定\n""b 返回\n")choice_id = input("\33[34;0m選擇要進入模式的ID\33[0m:")if choice_id == "1":shopping.catcar_record(current_user)elif choice_id == "2":shopping.updata_password(current_user)elif choice_id == "3":shopping.updata_address(current_user)elif choice_id == "4":shopping.link_creditcard(current_user)elif choice_id == "b":breakelse:print("\33[31;0m輸入的ID無效,請重新選擇\33[0m")elif choice_id == "b":breakelse:print("\33[31;0m輸入的ID無效,請重新選擇\33[0m")elif choice_id == "2":res = authentication.creditcard_auth()if res != None:if res[0] == "True":current_creditcard= res[1]while True:print("\33[36;1m信用卡中心\33[0m".center(50, "*"),"\n1 我的信用卡\n""2 提現\n""3 轉賬\n""4 還款\n""5 流水記錄\n""b 返回\n")choice_id = input("\33[34;0m選擇要進入模式的ID\33[0m:")if choice_id == "1":creditcard.my_creditcard(current_creditcard)elif choice_id == "2":creditcard.cash_advance(current_creditcard)elif choice_id == "3":creditcard.transfer_accounts(current_creditcard)elif choice_id == "4":creditcard.repayment(current_creditcard)elif choice_id == "5":creditcard.catcard_record(current_creditcard)elif choice_id == "b":breakelse:print("\33[31;0m輸入的ID無效,請重新選擇\33[0m")elif choice_id == "3":res = authentication.admincenter_auth()if res != None:while True:print("\33[36;1m管理中心\33[0m".center(50, "*"),"\n1 創建賬號\n""2 鎖定賬號\n""3 解鎖賬號\n""4 發行信用卡\n""5 凍結信用卡\n""6 解凍信用卡\n""7 提升信用卡額度\n""b 返回\n")choice_id = input("\33[34;0m選擇要進入模式的ID\33[0m:")if choice_id == "1":admincenter.user_create()elif choice_id == "2":admincenter.lock_user()elif choice_id == "3":admincenter.unlock_user()elif choice_id == "4":admincenter.creditcard_create()elif choice_id == "5":admincenter.lock_creditcard()elif choice_id == "6":admincenter.unlock_creditcard()elif choice_id == "7":admincenter.updata_limit()elif choice_id == "b":breakelse:print("\33[31;0m輸入的ID無效,請重新選擇\33[0m")elif choice_id == "q":breakelse:print("\33[31;0m輸入的ID無效,請重新選擇\33[0m")2、modules目錄下的模塊:
- 管理中心模塊admincenter.py #!/usr/bin/python #_*_coding:utf-8_*_
import os,json
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file)))
數據庫文件相對路徑
db_users_dict = os.path.join(BASE_DIR,'database','user_dict')
db_creditcard_dict = os.path.join(BASE_DIR,'database','creditcard_dict')
創建用戶
def user_create(address=None,locked=0,creditcard=0):
while True:
print(' 開始創建用戶 '.center(50,'#'))
with open(__db_users_dict,'r+') as f_users_dict:
users_dict = json.loads(f_users_dict.read())
for key in users_dict:
print('系統已有用戶【%s】' % (key))
創建信用卡
def creditcard_create(limit=15000,locked=0):
while True:
print(' 發行信用卡 '.center(50,'#'))
with open(__db_creditcard_dict,'r+') as f_createcard_dict:
creditcard_dict = json.loads(f_createcard_dict.read())
for key in creditcard_dict:
print('系統已有信用卡 【%s】 \t持卡人 【%s】' % (key,creditcard_dict[key]['personinfo']))
if_create = input('\n\33[34;0m是否發行新的信用卡 確定【y】/返回【b】\33[0m: ').strip()
if if_create == 'y':
creditcard = input('\33[34;0m輸入要發行信用卡卡號(6位數字):\33[0m').strip()
if creditcard not in creditcard_dict.keys():
if creditcard.isdigit() and len(creditcard.strip()) == 6:
password = input('\33[34;0m輸入要發行信用卡的密碼:\33[0m').strip()
if len(password) > 0:
personinfo = input('\33[34;0m輸入要發行信用卡申請人:\33[0m')
if len(personinfo.strip()) > 0:
creditcard_dict[creditcard] = {
'creditcard':creditcard, 'password':password, 'personinfo':personinfo, 'limit':limit, 'limitcash':limit//2, 'locked':locked, 'deflimit':limit
}
dict = json.dumps(creditcard_dict)
f_createcard_dict.seek(0)
f_createcard_dict.truncate(0)
f_createcard_dict.write(dict)
print('\33[31;0m發行信用卡 %s 成功 額度 %s\33[0m\n' %(creditcard,limit))
else:
print('\33[31;0m信用卡申請人不能為空\33[0m\n')
else:
print('\33[31;0m信用卡 %s 卡號不符合規范\33[0m\n' %(creditcard))
else:
print('\33[31;0m信用卡 %s 已經存在\33[0m\n' %(creditcard))
if if_create == 'b':
break
鎖定用戶
def lock_user():
while True:
print(' \33[32;0m鎖定用戶\33[0m '.center(50,'#'))
with open(__db_users_dict,'r+') as f_user_dict:
user_dict = json.loads(f_user_dict.read())
for key in user_dict:
if user_dict[key]['locked'] == 0:
print('系統用戶 【%s】\t\t鎖定狀態:【未鎖定】' %(key))
else:
print('系統用戶 【%s】\t\t鎖定狀態:\33[7m【已鎖定】\33[0m' %(key))
if_lock = input('\n\33[34;0m是否進行用戶鎖定 確定【y】/返回【b】\33[0m: ').strip()
if if_lock == 'y':
lock_user = input('\33[34;0m輸入要鎖定的用戶名\33[0m: ').strip()
if lock_user in user_dict.keys():
if user_dict[lock_user]['locked'] == 0:
user_dict[lock_user]['locked'] = 1
dict = json.dumps(user_dict)
f_user_dict.seek(0)
f_user_dict.truncate(0)
f_user_dict.write(dict)
print('\33[31;1m用戶 %s 鎖定成功\33[0m\n' %(lock_user))
else:
print('\33[31;0m用戶 %s 鎖定失敗 之前已經被鎖定\33[0m\n' %(lock_user))
else:
print('\33[31;0m用戶 %s 不存在\33[0m\n' %(lock_user))
if if_lock == 'b':
break
解鎖用戶
def unlock_user():
while True:
print('\33[32;0m解鎖用戶\33[0m'.center(50,'#'))
with open(__db_users_dict,'r+') as f_user_dict:
user_dict = json.loads(f_user_dict.read())
for key in user_dict:
if user_dict[key]['locked'] == 0:
print('系統用戶 【%s】\t\t鎖定狀態:【未鎖定】' %(key))
else:
print('系統用戶 【%s】\t\t鎖定狀態:\33[7m【已鎖定】\33[0m' %(key))
if_lock = input('\n\33[34;0m是否進行用戶解鎖 確定【y】/返回【b】\33[0m: ')
if if_lock == 'y':
unlock_user = input('\33[34;0m輸入要解鎖的用戶名\33[0m:')
if unlock_user in user_dict.keys():
if user_dict[unlock_user]['locked'] == 1:
user_dict[unlock_user]['locked'] = 0
dict = json.dumps(user_dict)
f_user_dict.seek(0)
f_user_dict.truncate(0)
f_user_dict.write(dict)
print('\33[31;1m用戶 %s 解鎖成功\33[0m\n' %(unlock_user))
else:
print('\33[31;0m用戶 %s 解鎖失敗 用戶未被鎖定\33[0m\n' %(unlock_user))
else:
print('\33[31;0m用戶 %s 不存在\33[0m\n' %(unlock_user))
if if_lock == 'b':
break
凍結信用卡
def lock_creditcard():
while True:
print('\33[32;0m凍結信用卡\33[0m'.center(50,'#'))
with open(__db_creditcard_dict,'r+') as f_creditcard_dict:
creditcard_dict = json.loads(f_creditcard_dict.read())
for key in creditcard_dict:
if creditcard_dict[key]['locked'] == 0:
print('信用卡 【%s】\t\t凍結狀態:【未凍結】' % (key))
else:
print('信用卡 【%s】\t\t凍結狀態:\33[7m【已凍結】\33[0m' % (key))
解凍信用卡
def unlock_crditcard():
while True:
print('\33[32;0m解凍信用卡\33[0m'.center(50,'#'))
with open(__db_creditcard_dict,'r+') as f_creditcard_dict:
creditcard_dict = json.loads(f_creditcard_dict.read())
for key in creditcard_dict.keys():
if creditcard_dict[key]['locked'] == 0:
print('信用卡 【%s】\t\t凍結狀態:【未凍結】' % (key))
else:
print('信用卡 【%s】\t\t凍結狀態:\33[7m【已凍結】\33[0m' % (key))
if_unlock = input('\n\33[34;0m是否進行信用卡解凍 確定【y】/返回【b】\33[0m:')
if if_unlock == 'y':
creditcard = input('\33[34;0m輸入要解凍的信用卡卡號\33[0m:').strip()
if creditcard.isdigit() and len(creditcard) == 6:
if creditcard in creditcard_dict.keys():
if creditcard_dict[creditcard]['locked'] == 1:
creditcard_dict[creditcard]['locked'] = 0
dict = json.dumps(creditcard_dict)
f_creditcard_dict.seek(0)
f_creditcard_dict.truncate(0)
f_creditcard_dict.write(dict)
print('\33[31;1m信用卡 %s 解凍成功\33[0m\n' % (creditcard))
else:
print('\33[31;0m信用卡 %s 解凍失敗 之前未被凍結\33[0m\n' % (creditcard))
else:
print('\33[31;0m信用卡 %s 不存在\33[0m\n' % (creditcard))
else:
print('\33[31;0m信用卡 %s 不合法,請輸入6位的卡號\33[0m\n' % (creditcard))
if if_unlock == 'b':
break
修改信用卡額度
def updata_limit():
while True:
print(' \33[32;0m修改信用卡額度\33[0m '.center(70,'#'))
with open(__db_creditcard_dict,'r+') as f_creditcard_dict:
creditcard_dict = json.loads(f_creditcard_dict.read())
for key in creditcard_dict.keys():
limitcash = creditcard_dict[key]['limitcash']
print('信用卡 【%s】\t目前可用額度:【¥%s】\t取現額度:【¥%s】' % (key,creditcard_dict[key]['limit'],limitcash))
if_updata = input('\n\33[34;0m是否進行信用卡額度調整 確定【y】/返回【b】\33[0m:')
if if_updata == 'y':
creditcard = input('\33[34;0m輸入要修改額度的信用卡卡號\33[0m:').strip()
if creditcard.isdigit() and len(creditcard) == 6:
if creditcard in creditcard_dict.keys():
limit = input('\33[34;0m輸入額度修改后的金額(至少¥5000)\33[0m:').strip()
if limit.isdigit():
limit_default = creditcard_dict[creditcard]['deflimit']
limit = int(limit)
if limit >= 5000:
updata = limit - limit_default
creditcard_dict[creditcard]['limit'] += updata
creditcard_dict[creditcard]['limitcash'] += updata//2
creditcard_dict[creditcard]['deflimit'] = limit
dict = json.dumps(creditcard_dict)
f_creditcard_dict.seek(0)
f_creditcard_dict.truncate(0)
f_creditcard_dict.write(dict)
print('\33[31;1m信用卡 %s 額度修改成功 額度 %s \33[0m\n' % (creditcard,limit))
else:
print('\33[31;0m輸入金額 ¥%s 小于¥5000\33[0m\n' % (limit))
else:
print('\33[31;0m輸入金額 ¥%s 格式錯誤\33[0m\n' % (limit))
else:
print('\33[31;0m信用卡 【%s】 不存在\33[0m\n' % (creditcard))
else:
print('\33[31;0m信用卡 %s 不合法,請輸入6位的卡號\33[0m\n' % (creditcard))
if if_updata == 'b':
break
#!/usr/bin/python
#_coding:utf-8_
import os,json
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file)))
數據庫文件相對路徑
db_user_dict = os.path.join(BASE_DIR,'database','user_dict')
db_creditcard_dict = os.path.join(BASE_DIR,'database','creditcard_dict')
認證裝飾器
def auth(auth_type):
def outer_wrapper(func):
if auth_type == 'user_auth':
def wrapper():
res = func()
username = input('\33[34;0m請輸入用戶名:\33[0m').strip()
password = input('\33[34;0m請輸入密碼:\33[0m').strip()
if len(username) > 0:
with open(db_user_dict,'r+') as f_users_dict:
users_dict = json.loads(f_users_dict.read())
if username in users_dict.keys():
if password == users_dict[username]['password']:
if users_dict[username]['locked'] == 0:
print('\33[31;0m用戶 %s 認證成功\33[0m' %(username))
return res,username
else:
print('\33[31;0m用戶 %s 已經被鎖定 認證失敗\33[0m' %(username))
else:
print('\33[31;0m輸入的密碼不匹配 認證失敗\33[0m')
else:
print('\33[31;0m輸入的用戶名不存在 認證失敗\33[0m')
else:
print('\33[31;0m輸入的用戶名為空 認證失敗\33[0m')
return wrapper
if auth_type == 'creditcard_auth':
def wrapper():
res = func()
creditcard = input('\33[34;0m輸入信用卡卡號(6位數字):\33[0m').strip()
password = input('\33[34;0m輸入信用卡的密碼:\33[0m').strip()
if len(creditcard) > 0:
with open(db_creditcard_dict,'r+') as f_creditcard_dict:
creditcard_dict = json.loads(f_creditcard_dict.read())
if creditcard in creditcard_dict.keys():
if password == creditcard_dict[creditcard]['password']:
if creditcard_dict[creditcard]['locked'] == 0:
print('\33[31;0m信用卡 %s 認證成功\33[0m' %(creditcard))
return res,creditcard
else:
print('\33[31;0m信用卡 %s 已經被凍結 認證失敗\33[0m' %(creditcard))
else:
print('\33[31;0m輸入的密碼不匹配 認證失敗\33[0m')
else:
print('\33[31;0m輸入的信用卡卡號不存在 認證失敗\33[0m')
else:
print('\33[31;0m輸入的信用卡卡號為空 認證失敗\33[0m')
return wrapper
@auth(auth_type="user_auth")
def user_auth():
'''
用戶登錄認證
:return:
'''''
print(' \33[32;0m用戶登錄認證\33[0m '.center(50,'#'))
return True
@auth(auth_type="creditcard_auth")
def creditcard_auth():
'''
信用卡認證
:return:
'''''
print(' \33[32;0m信用卡登錄認證\33[0m '.center(50,'#'))
return True
@auth(auth_type="admincenter_auth")
def admincenter_auth():
'''
管理后臺登錄認證
:return:
'''''
print(' \33[32;0m后臺管理登錄認證\33[0m '.center(50,'#'))
return True
#!/usr/bin/python
#_coding:utf-8_
import os,json,datetime,time
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file)))
數據庫文件相對路徑
db_creditcard_dict = os.path.join(BASE_DIR,'database','creditcard_dict')
db_details_tip = os.path.join(BASE_DIR,'database','details_tip')
__db_creditcard_record = os.path.join(BASE_DIR,'database','creditcard_record')
def details_tip():
'''
取現須知
:return:
'''''
with open(__db_details_tip,'r',encoding='utf-8') as f_details_tip:
print(f_details_tip.read())
def my_creditcard(current_creditcard):
'''
我的信用卡
:return:
'''''
while True:
print(' \33[32;0m我的信用卡信息\33[0m '.center(50,'#'))
with open(__db_creditcard_dict,'r+') as f_creditcard_dict:
creditcard_dict = json.loads(f_creditcard_dict.read())
print('卡號:\t【%s】\n額度:\t【¥%s】\n提現額度:\t【¥%s】\n持卡人:\t【%s】\n ' \
% (current_creditcard,creditcard_dict[current_creditcard]['limit'],creditcard_dict[current_creditcard]['limitcash'],\
creditcard_dict[current_creditcard]['personinfo']))
if_back = input('\33[34;0m是否退出 返回【b】\33[0m: ')
if if_back == 'b':
break
def creditcard_record(creditcard,value):
'''
信用卡流水記錄
:return:
'''''
with open(__db_creditcard_record,'r+') as f_creditcard_record:
record_dict = json.loads(f_creditcard_record.read())
mouth = time.strftime('%Y-%m-%d', time.localtime())
times = time.strftime('%H:%M:%S')
if str(creditcard) not in record_dict.keys():
record_dict[creditcard] = {mouth:{times:value}}
else:
if mouth not in record_dict[creditcard].keys():
record_dict[creditcard][mouth] = {times:value}
else:
record_dict[creditcard][mouth][times] = value
dict = json.dumps(record_dict)
f_creditcard_record.seek(0)
f_creditcard_record.truncate(0)
f_creditcard_record.write(dict)
def cash_advance(current_creditcard):
'''
取現
:return:
'''''
while True:
print('\33[32;0m提現\33[0m'.center(50,'#'))
with open(__db_creditcard_dict,'r+') as f_creditcard_dict:
creditcard_dict = json.loads(f_creditcard_dict.read())
limit = creditcard_dict[current_creditcard]['limit']
limitcash = creditcard_dict[current_creditcard]['limitcash']
print('信用卡號:\t【%s】\n提現額度:\t【¥%s】' % (current_creditcard,limitcash))
if limit >= limitcash:
print('可提現金額:\t【¥%s】\n' % (limitcash))
details_tip()
if_adv = input('\n\33[34;0m是否進行提現 確定【y】/返回【b】\33[0m: ')
if if_adv == 'y':
cash = input('\33[34;0m輸入要提現的金額 收取%5手續費\33[0m:').strip()
if cash.isdigit():
cash = int(cash)
if cash != 0:
if cash <= limitcash:
limitcash = limitcash - int(cash1.05)
limit = limit - int(cash1.05)
creditcard_dict[current_creditcard]['limit'] = limit
creditcard_dict[current_creditcard]['limitcash'] = limitcash
dict = json.dumps(creditcard_dict)
f_creditcard_dict.seek(0)
f_creditcard_dict.truncate(0)
f_creditcard_dict.write(dict)
record = '\33[31;1m提現¥%s 手續費¥%s\33[0m' %(limitcash,int(cash*0.05))
print(record,'\n')
else:
print('\33[31;0m超出信用卡提現額度\33[0m\n')
else:
print('\33[31;0m提現額度不能為空\33[0m\n')
if if_adv == 'b':
break
def transfer_accounts(current_creditcard):
'''
轉賬
:param current_creditcard:
:return:
'''''
while True:
print('\33[32;0m轉賬\33[0m'.center(50,'#'))
if_trans = input('\n\33[34;0m是否進行轉賬 確定【y】/返回【b】\33[0m: ')
if if_trans == 'y':
with open(__db_creditcard_dict,'r+') as f_creditcard_dict:
creditcard_dict = json.loads(f_creditcard_dict.read())
current_limit = creditcard_dict[current_creditcard]['limit']
transfer_creditcard = input('\33[34;0m輸入轉賬的銀行卡卡號\33[0m:')
if transfer_creditcard.isdigit() and len(transfer_creditcard) == 6:
if transfer_creditcard in creditcard_dict.keys():
again_creditcard = input('\33[34;0m再次確認轉賬的銀行卡卡號\33[0m:')
if transfer_creditcard == again_creditcard:
transfer_cash = input('\33[34;0m輸入轉賬的金額\33[0m:')
if transfer_cash.isdigit():
transfer_cash = int(transfer_cash)
if transfer_cash <= current_limit:
transfer_limit = creditcard_dict[current_creditcard]['limit']
creditcard_dict[current_creditcard]['limit'] = current_limit - transfer_cash
creditcard_dict[current_creditcard]['limit'] = transfer_cash + transfer_limit
dict = json.dumps(creditcard_dict)
f_creditcard_dict.seek(0)
f_creditcard_dict.truncate(0)
f_creditcard_dict.write(dict)
record = '\33[31;1m轉賬卡號 %s 金額 ¥%s 轉賬成功\33[0m' %(transfer_creditcard,transfer_cash)
print(record,'\n')
creditcard_record(current_creditcard,record)
else:
print('\33[31;0m金額不足 轉賬失敗\33[0m\n')
else:
print('\33[31;0m輸入金額有誤\33[0m\n')
else:
print('\33[31;0m兩次輸入銀行卡卡號不一致\33[0m\n')
else:
print('\33[31;0m輸入銀行卡不存在\33[0m\n')
else:
print('\33[31;0m輸入銀行卡不合法,請輸入6位的銀行卡號!\33[0m\n')
if if_trans == 'b':
break
transfer_accounts('888888')
def repayment(current_creditcard):
'''
還款
:param current_creditcard:
:return:
'''''
while True:
print(' \33[32;0m還款\33[0m '.center(50,'#'))
if_repay = input('\n\33[34;0m是否進行還款 確定【y】/返回【b】\33[0m:')
if if_repay == 'y':
repay_cash = input('\33[34;0m輸入要還款的金額\33[0m:').strip()
if repay_cash.isdigit():
repay_cash = int(repay_cash)
with open(__db_creditcard_dict, 'r+') as f_creditcard_dict:
creditcard_dict = json.loads(f_creditcard_dict.read())
limit = creditcard_dict[current_creditcard]['limit']
limit = limit + repay_cash
creditcard_dict[current_creditcard]['limit'] = limit
f_creditcard_dict.seek(0)
f_creditcard_dict.truncate(0)
dict = json.dumps(creditcard_dict)
f_creditcard_dict.write(dict)
record = '\33[31;1m信用卡 %s 還款金額 ¥%s 還款成功\33[0m' %(current_creditcard,repay_cash)
print(record,'\n')
creditcard_record(current_creditcard, record)
else:
print('\33[31;0m輸入金額格式有誤\33[0m\n')
if if_repay == 'b':
break
repayment('888888')
def catcard_record(current_creditcard):
'''
查看信用卡流水
:param current_creditcard:
:return:
'''''
while True:
print(' \33[32;0m信用卡流水單\33[0m '.center(50,'#'))
with open(__db_creditcard_record,'r+') as f_creditcard_record:
f_creditcard_record.seek(0)
record_dict = json.loads(f_creditcard_record.read())
print('\33[34;0m流水單日期\33[0m: ')
if current_creditcard in record_dict.keys():
if key in record_dict[current_creditcard]:
print(key)
date = input('"\n\33[34;0m流水單查詢 返回【b】 / 輸入流水單的日期【2018-01-10】\33[0m: ').strip()
if date == 'b':
break
if date in record_dict[current_creditcard].keys():
keys = sorted(record_dict[current_creditcard][date])
print('\33[31;1m當前信用卡【%s】 交易記錄-》》\33[0m' % (current_creditcard))
for key in keys:
print('\33[31;1m時間:%s %s\33[0m' %(key,record_dict[current_creditcard][date][key]))
print('')
else:
print('\33[31;0m輸入的日期有誤\33[0m\n')
else:
print('\33[31;0m信用卡 %s 還沒有進行過消費\33[0m\n' %(current_creditcard))
break
catcard_record('888888')
* 購物模塊shopping.py#!/usr/bin/python
#_coding:utf-8_
import os,json,time
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file)))
數據庫文件相對路徑
__db_product = os.path.join(BASE_DIR,'database','product_list')
db_shopping_car = os.path.join(BASE_DIR,'database','shopping_car')
db_users_dict = os.path.join(BASE_DIR,'database','users_dict')
db_creditcard_dict = os.path.join(BASE_DIR,'databse','creditcard_dict')
db_shopping_record = os.path.join(BASE_DIR,'database','shopping_record')
__db_creditcard_record = os.path.join(BASE_DIR,'database','creditcard_record')
購物商城
def shopping_mall():
shopping_list,pro_list = [],[]
with open(__db_product,'r',encoding='utf-8') as f_product:
for item in f_product:
pro_list.append(item.strip('\n').split())
清空購物車
def empty_shopping_car():
with open(__db_shopping_car,'r+') as f_shopping_car:
list = json.dumps([])
f_shopping_car.write(list)
購物車
def shopping_car():
while True:
with open(__db_shopping_car,'r+') as f_shopping_car:
list = json.loads(f_shopping_car.read())
sum = 0
print(' \33[32;0m購物車信息清單\33[0m '.center(50,'#'))
for index,item in enumerate(list):
print(index+1,item[0],item[1])
sum += int(item[1])
print('\33[31;1m商品總額共計: %s\33[0m' %sum)
if_buy = input('\n\33[34;0m選擇要進行的操作 返回【b】/清空【f】\33[0m: ')
if if_buy == 'b':
break
if if_buy == 'f':
empty_shopping_car()
購物記錄
def shoppingcar_record(current_user,value):
with open(__db_creditcard_record,'r+') as f_shoppingcar_record:
record_dict = json.loads(f_shoppingcar_record.read())
mouth = time.strftime('%Y-%m-%d ', time.localtime())
times = time.strftime('%H:%M:%S')
if str(current_user) not in record_dict.keys():
record_dict[current_user] = {mouth:{times:value}}
else:
if mouth not in record_dict[current_user].keys():
record_dict[current_user][mouth] = {times:value}
else:
record_dict[current_user][mouth][times] = value
dict = json.dumps(record_dict)
f_shoppingcar_record.seek(0)
f_shoppingcar_record.truncate(0)
f_shoppingcar_record.write(dict)
查看購物記錄
def catcar_record(current_user):
while True:
print(' \33[32;0m用戶 %s 購物記錄\33[0m '.center(50,'#') %(current_user))
with open(__db_shopping_record,'r+') as f_shopping_record:
record_dict = json.loads(f_shopping_record.read())
if current_user not in record_dict.keys():
print(' \33[31;0m用戶 %s 還沒有進行過消費\33[0m\n ' % (current_user))
else:
data = sorted(record_dict[current_user])
for d in data:
times = sorted(record_dict[current_user][d])
for t in times:
print('\33[31;0m【時間】 %s %s\33[0m' %(d,t))
items = record_dict[current_user][d][t]
print('\33[31;0m【商品】 【價格】\33[0m')
for v in items:
print('\33[31;0m %s\t\t%s\33[0m' %(v[0],v[1]))
if_back = input('\n\33[34;0m是否返回 返回【b】\33[0m:')
if if_back == 'b':
break
信用卡使用記錄
def creditcard_record(creditcard,value):
with open(__db_creditcard_record,'r+') as f_creditcard_record:
record_dict = json.loads(f_creditcard_record.read())
mouth = time.strftime('%Y-%m-%d', time.localtime())
times = time.strftime('%H-%M-%S')
if str(creditcard) not in record_dict.keys():
record_dict[creditcard] = {mouth:{times:value}}
else:
if mouth not in record_dict[creditcard].keys():
record_dict[creditcard][mouth] = {times:value}
else:
record_dict[creditcard][mouth][times] = value
dict = json.dumps(record_dict)
f_creditcard_record.seek(0)
f_creditcard_record.truncate(0)
f_creditcard_record.write(dict)
信用卡密碼認證
def auth_creditcard(creditcard):
with open(__db_creditcard_dict,'r+') as f_creditcard_dict:
creditcard_dict = json.loads(f_creditcard_dict.read())
passwd = input('\33[34;0m當前信用卡【%s】 請輸入支付密碼:\33[0m: ' %(creditcard))
if passwd == creditcard_dict[creditcard]['password']:
return True
else:
print('\33[31;0m密碼輸入錯誤,支付失敗\33[0m')
購物車結算
def pay_shopping(current_user):
while True:
sum = 0
print(' \33[32;0m購物結算\33[0m '.center(50,'#'))
with open(db_shopping_car,'r+') as f_shopping_car:
list = json.loads(f_shopping_car.read())
for item in list:
sum += int(item[1])
if_pay = input('\n\n\33[34;0m當前商品總額:%s 是否進行支付 確定【y】/返回【b】\33[0m:' %(sum))
if if_pay == 'y':
with open(db_users_dict,'r+') as f_users_dict:
users_dict = json.loads(f_users_dict.read())
creditcard = users_dict[current_user]['credictcard']
if creditcard == 0:
print('\33[31;0m賬號 %s未綁定信用卡,請到個人中心里修改信用卡綁定\33[0m\n' %(current_user))
else:
with open(__db_creditcard_dict,'r+') as f_credictcard_dict:
credictcard_dict = json.loads(f_credictcard_dict.read())
limit = credictcard_dict[creditcard]['limit']
limit_new = limit - sum
if limit_new > 0:
res = auth_creditcard(creditcard)
if res == True:
credictcard_dict[creditcard]['limit'] = limit_new
dict = json.dumps(credictcard_dict)
f_credictcard_dict.seek(0)
f_credictcard_dict.truncate(0)
f_credictcard_dict.write(dict)
value = '購物支付 %s' %(sum)
print('\33[31;1m支付成功,當前余額 %s元\33[0m\n' %(limit_new))
shoppingcar_record(current_user,list)
credictcard_record(creditcard,value)
empty_shopping_car()
else:
print('\33[31;0m當前信用卡額度 %s元 不足矣支付購物款 可綁定其他信用卡支付\33[0m\n ' %(limit))
if if_pay == 'b':
break
信用卡綁定
def link_creditcard(current_user):
while True:
print(' \33[32;0m修改信用卡綁定\33[0m '.center(50,'#'))
with open(__db_users_dict,'r+') as f_users_dict:
users_dict = json.loads(f_users_dict.read())
creditcard = users_dict[current_user]['creditcard']
if creditcard == 0:
print('當前賬號: \t%s' %(creditcard))
print('信用卡綁定:\33[31;0m未綁定\33[0m\n')
else:
print('當前賬號: \t%s' %(creditcard))
print('綁定的信用卡: %s\n' %(creditcard))
修改密碼
def updata_password(current_user):
while True:
print(' \33[32;0m修改登錄密碼\33[0m '.center(50,'#'))
print('當前賬號:\t%s\n當前密碼:\t**\n' %(current_user))
if_updata = input('\33[34;0m是否要修改 % s登錄密碼 確定【y】/返回【b】\33[0m:' %(current_user))
if if_updata == 'y':
with open(__db_users_dict,'r+') as f_users_dict:
users_dict = json.loads(f_users_dict.read())
password = users_dict[current_user]['password']
old_pwd = input('\33[34;0m輸入原來的密碼\33[0m:').strip()
if old_pwd == password:
new_pwd = input('\33[34;0m輸入新的密碼\33[0m:').strip()
again_pwd = input('\33[34;0m再輸入新的密碼\33[0m:').strip()
if new_pwd == again_pwd:
users_dict[current_user]['password'] = new_pwd
dict = json.dumps(users_dict)
f_users_dict.seek(0)
f_users_dict.truncate(0)
f_users_dict.write(dict)
print('\33[31;1m密碼修改成功\33[0m\n')
else:
print('\33[31;0m兩次密碼不一致\33[0m\n')
else:
print('\33[31;0m密碼不正確\33[0m\n')
修改個人資料
def updata_address(current_user):
while True:
print(' \33[32;0m修改個人資料\33[0m '.center(50,'#'))
with open(__db_users_dict,'r+') as f_users_dict:
users_dict = json.loads(f_users_dict.read())
address = users_dict[current_user]['address']
print('當前賬號:\t%s\n當前收貨地址:\t%s\n' %(current_user,address))
if_updata = input('\33[34;0m是否要修改 % s登錄密碼 確定【y】/返回【b】\33[0m: ' %(current_user))
if if_updata == 'y':
new_address = input('\33[34;0m輸入新的收貨地址\33[0m: ').strip()
users_dict[current_user]['address'] = new_address
dict = json.dumps(users_dict)
f_users_dict.seek(0)
f_users_dict.truncate(0)
f_users_dict.write(dict)
print('\33[31;1m收貨地址修改成功\33[0m\n')
if if_updata == 'b':
break
#!/usr/bin/python
#_coding:utf-8_
from conf import setting
import logging.config
def logger_handle(log_name):
logging.config.dictConfig(setting.LOGGING_DIC) # 導入上面定義的logging配置
logger = logging.getLogger(log_name) # 生成一個log實例
return logger
{"888888": {"personinfo": "\u91d1\u89d2\u5927\u738b", "password": "123", "limit": 14288, "locked": 0, "limitcash": 485, "deflimit": 10000, "creditcard": "888888"}, "666666": {"creditcard": "666666", "password": "123", "personinfo": "24K\u7eaf\u5e05", "limit": 15000, "limitcash": 7500, "locked": 0, "deflimit": 15000}}
信用卡流水記錄數據庫creditcard_record{"888888": {"2018-01-10": {"09:59:31": "\u8d2d\u7269\u652f\u4ed8 6297", "10:24:55": "\u001b[31;1m\u4fe1\u7528\u5361 888888 \u8fd8\u6b3e\u91d1\u989d \uffe55000 \u8fd8\u6b3e\u6210\u529f\u001b[0m", "10:22:48": "\u001b[31;1m\u8f6c\u8d26\u5361\u53f7 666666 \u91d1\u989d \uffe51000 \u8f6c\u8d26\u6210\u529f\u001b[0m", "11:14:54": "\u001b[31;1m\u8f6c\u8d26\u5361\u53f7 666666 \u91d1\u989d \uffe51000 \u8f6c\u8d26\u6210\u529f\u001b[0m", "10:19:55": "\u001b[31;1m\u63d0\u73b0\uffe52000 \u624b\u7eed\u8d39\uffe5100\u001b[0m", "10:19:45": "\u001b[31;1m\u63d0\u73b0\uffe5300 \u624b\u7eed\u8d39\uffe515\u001b[0m"}}}
信用卡取現流程需知details_tip信用卡取現需知-》》
①信用卡默認取現額度為信用卡總額度的50%(此系統默認取現額度為7500)
②信用卡進行消費時(未取現),取現額度不會變化
③信用卡額度低于取現額度時,可取現金額以當前額度為準(可取現金額=當前額度*0.95)
④取現額度只有兩種狀況會發生變化,一種進行取現,第二是對信用卡額度進行調整
⑤每次取現扣除5%的手續費
iPhone 1299
iWatch 2999
MacPro 11999
iPad 2199
Bicycle 999
TPlink 1199
Letv 819
Book 599
[]
用戶購物流水賬單數據庫shopping_record{"hgz": {"2018-01-10": {"09:59:31": [["iPhone", "1299"], ["iWatch", "2999"], ["MacBo", "1999"]]}}}
用戶信息數據庫users_dict{"hgz": {"username": "hgz", "password": "123", "creditcard": 0, "address": "None", "locked": 0}, "hgz1": {"username": "hgz1", "password": "123", "creditcard": 0, "address": "null", "locked": 0}}
5、conf目錄下的settings#!/usr/bin/python
#_coding:utf-8_
import logging.config
import os
BASE_DIR=os.path.dirname(os.path.dirname(os.path.abspath(file)))
LOG_PATH=os.path.join(BASE_DIR,'log','access.log')
ERROR_PATH=os.path.join(BASE_DIR,'log','error.log')
DB_PATH=os.path.join(BASE_DIR,'db','user')
定義三種日志輸出格式 開始
standard_format = '[%(asctime)s][%(threadName)s:%(thread)d][task_id:%(name)s][%(filename)s:%(lineno)d]' \
'[%(levelname)s][%(message)s]'
simple_format = '[%(levelname)s][%(asctime)s][%(filename)s:%(lineno)d]%(message)s'
id_simple_format = '[%(levelname)s][%(asctime)s] %(message)s'
log配置字典
LOGGING_DIC = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'standard': {
'format': standard_format
},
'simple': {
'format': simple_format
},
'id_simple' : {
'format' : id_simple_format
},
},
'filters': {},
'handlers': {
#打印到終端的日志
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler', # 打印到屏幕
'formatter': 'simple'
},
#打印到文件的日志,收集info及以上的日志
'default': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler', # 保存到文件
'formatter': 'standard',
'filename': LOG_PATH, # 日志文件
'maxBytes': 102410245, # 日志大小 5M
'backupCount': 5,
'encoding': 'utf-8', # 日志文件的編碼,再也不用擔心中文log亂碼了
},
'errorcode': {
'level': 'ERROR',
'class': 'logging.handlers.RotatingFileHandler', # 保存到文件
'formatter': 'simple',
'filename': ERROR_PATH, # 日志文件
'maxBytes': 102410245, # 日志大小 5M
'backupCount': 5,
'encoding': 'utf-8', # 日志文件的編碼,再也不用擔心中文log亂碼了
},
},
'loggers': {
'': {
'handlers': ['default', 'console','collect'], # 這里把上面定義的兩個handler都加上,即log數據既寫入文件又打印到屏幕
'level': 'DEBUG',
'propagate': False, # 向上(更高level的logger)傳遞
},
},
}
轉載于:https://blog.51cto.com/11019859/2060110
總結
以上是生活随笔為你收集整理的python模拟ATM + 购物商城的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: jQuery代码优化的9种方法
- 下一篇: WX公众号授权登录的简单应用