parent
b1f9f16a38
commit
5c48bc9cf7
@ -0,0 +1,3 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
@ -0,0 +1 @@
|
||||
银行系统.py
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Python 3.8 (py)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="TestRunnerService">
|
||||
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
|
||||
</component>
|
||||
</module>
|
@ -0,0 +1,22 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="PyPep8Inspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||
<option name="ignoredErrors">
|
||||
<list>
|
||||
<option value="E266" />
|
||||
<option value="E303" />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||
<option name="ignoredErrors">
|
||||
<list>
|
||||
<option value="N802" />
|
||||
<option value="N806" />
|
||||
<option value="N803" />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (py)" project-jdk-type="Python SDK" />
|
||||
</project>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/bankSystem.iml" filepath="$PROJECT_DIR$/.idea/bankSystem.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,65 @@
|
||||
from card import Card
|
||||
import json
|
||||
|
||||
|
||||
# 读
|
||||
class ReadCard(Card):
|
||||
def __init__(self, cardN='', cardPassword='', cardMoney=0, identityId='', phoneNum='', cardLock=''):
|
||||
Card.__init__(self, cardN, cardPassword, cardMoney, identityId, phoneNum, cardLock)
|
||||
|
||||
def dict2Card(self, d):
|
||||
return self.__class__(d["cardN"], d["cardPassword"], d["cardMoney"], d["identityId"], d["phoneNum"],
|
||||
d["cardLock"])
|
||||
|
||||
def read(self):
|
||||
with open("cardinfo.txt", "r", encoding="utf-8") as fr:
|
||||
cards = []
|
||||
for re in fr.readlines():
|
||||
cards.append(self.dict2Card(eval(re)))
|
||||
return cards
|
||||
|
||||
|
||||
# 写
|
||||
class AppendCard(Card):
|
||||
def __init__(self):
|
||||
Card.__init__(self, cardN='', cardPassword='', cardMoney=0, identityId='', phoneNum='', cardLock='')
|
||||
|
||||
def card2Dict(self, card):
|
||||
return {"cardN": card.cardN, "cardPassword": card.cardPassword,
|
||||
"cardMoney": card.cardMoney, "identityId": card.identityId,
|
||||
"phoneNum": card.phoneNum, "cardLock": card.cardLock
|
||||
}
|
||||
|
||||
def append(self, card, w='a'):
|
||||
# 清除
|
||||
if w == 'w':
|
||||
with open("cardinfo.txt", "w", encoding="utf-8") as fa:
|
||||
fa.write('')
|
||||
else:
|
||||
with open("cardinfo.txt", "a", encoding="utf-8") as fa:
|
||||
json.dump(card, fa, default=self.card2Dict)
|
||||
fa.write('\n')
|
||||
|
||||
|
||||
# 删
|
||||
class Del(object):
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def del_(self, cardN):
|
||||
readcard = ReadCard()
|
||||
cards = readcard.read()
|
||||
for card in cards:
|
||||
if cardN == card.cardN:
|
||||
cards.remove(card)
|
||||
break
|
||||
else:
|
||||
print("卡号不存在,请重新输入!")
|
||||
return False
|
||||
|
||||
appendcard = AppendCard()
|
||||
appendcard.append('', w='w')
|
||||
for card in cards:
|
||||
appendcard.append(card)
|
||||
return True
|
||||
|
@ -0,0 +1,35 @@
|
||||
from admin import Admin
|
||||
from atm import ATM
|
||||
|
||||
admin = Admin("admin",'123456')
|
||||
admin.window()
|
||||
atm = ATM()
|
||||
admin.login()
|
||||
|
||||
while True:
|
||||
admin.funcWindow()
|
||||
choice = input("请选择您要办理的业务:")
|
||||
if choice == '1':
|
||||
atm.newAccount()
|
||||
elif choice == '2':
|
||||
atm.checkMoney()
|
||||
elif choice == '3':
|
||||
atm.saveMoney()
|
||||
elif choice == '4':
|
||||
atm.getMoney()
|
||||
elif choice == '5':
|
||||
atm.inMoney()
|
||||
elif choice == '6':
|
||||
atm.DAccount()
|
||||
elif choice == '7':
|
||||
atm.hangOutAccount()
|
||||
elif choice == '8':
|
||||
atm.unlockAccount()
|
||||
elif choice == '9':
|
||||
atm.changePassword()
|
||||
elif choice == 'T':
|
||||
if atm.exit():
|
||||
if admin.logout():
|
||||
break
|
||||
else:
|
||||
print("未有此功能!")
|
Loading…
Reference in new issue