Feature: Listing banks

master
Matt Theissen 3 years ago
parent 4798693ba1
commit 2820217c8e

@ -1,9 +1,8 @@
#!/usr/bin/env python3
import sqlite3
import os
def selectBank():
print('Make things to select the bank...')
listBank()
def addBank():
bankName = input("What would you like to call this bank? ")
@ -27,6 +26,14 @@ def addBank():
print(f'*** Added bank {bankName}')
print()
def listBank():
dirOutput = os.listdir()
matchs = [match for match in dirOutput if 'db.sqlite' in match]
print()
print('Banks found: ')
for i in matchs:
print(i.split(".")[0])
while True:
print("""
1. Select a Bank.
@ -37,11 +44,11 @@ while True:
""")
mainOption = input("Choose an option: ")
if mainOption == '1':
print('Place function here.')
selectBank()
elif mainOption == '2':
addBank()
elif mainOption == '3':
print('Place function here.')
listBank()
elif mainOption == '4':
print('Place function here.')
elif mainOption == 'Q' or mainOption == 'q':