|
|
|
@ -1,6 +1,29 @@
|
|
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
import sqlite3
|
|
|
|
|
import os
|
|
|
|
|
def manBankin(a):
|
|
|
|
|
while True:
|
|
|
|
|
bankNam = a.split(".")[0]
|
|
|
|
|
print("""
|
|
|
|
|
1. Withdraw
|
|
|
|
|
2. Deposit
|
|
|
|
|
3. Transfer
|
|
|
|
|
4. User Balance check
|
|
|
|
|
Q. Quit/Go Back
|
|
|
|
|
""")
|
|
|
|
|
userIn = input(f"Bank/{bankNam}: ")
|
|
|
|
|
if userIn == "1":
|
|
|
|
|
print("Withdraw")
|
|
|
|
|
elif userIn == "2":
|
|
|
|
|
print("Deposit")
|
|
|
|
|
elif userIn == "3":
|
|
|
|
|
print("Transfer")
|
|
|
|
|
elif userIn == "4":
|
|
|
|
|
print("User balance")
|
|
|
|
|
elif userIn == "q" or userIn == "Q":
|
|
|
|
|
break
|
|
|
|
|
else:
|
|
|
|
|
print('*** Option not understood. Please try again.')
|
|
|
|
|
|
|
|
|
|
def deluser(a):
|
|
|
|
|
userIn = input("Which user would you like to delete? ")
|
|
|
|
@ -51,22 +74,12 @@ def manageBankmenu(a):
|
|
|
|
|
elif menuOption == '3':
|
|
|
|
|
listuser(a)
|
|
|
|
|
elif menuOption == '4':
|
|
|
|
|
print('banking menu')
|
|
|
|
|
manBankin(a)
|
|
|
|
|
elif menuOption == 'q' or menuOption == 'Q':
|
|
|
|
|
break
|
|
|
|
|
else:
|
|
|
|
|
print('*** Option not understood. Please try again.')
|
|
|
|
|
|
|
|
|
|
def manageBank():
|
|
|
|
|
print()
|
|
|
|
|
#connDb = sqlite3.connect()
|
|
|
|
|
#cur = connDb.cursor()
|
|
|
|
|
#cur.execute('SELECT username from ACCOUNT;')
|
|
|
|
|
fmt = "{0}"
|
|
|
|
|
#for row in cur.fetchall():
|
|
|
|
|
# print(fmt.format(*row))
|
|
|
|
|
print()
|
|
|
|
|
|
|
|
|
|
def selectBank():
|
|
|
|
|
dirOutput = os.listdir()
|
|
|
|
|
matchs = [match for match in dirOutput if 'db.sqlite' in match]
|
|
|
|
|