示例#1
0
def main(fileName = None):
    if not fileName:
        bank = createBank(5)
    else:
        bank = Bank(fileName)
    print(bank)
    atm = ATM(bank)
    atm.mainloop()
示例#2
0
def main(fileName=None):
    """Creates the bank with the optional file name,
    wraps the window around it, and opens the window.
    Saves the bank when the window closes."""
    if not fileName:
        bank = createBank(5)
    else:
        bank = Bank(fileName)
    print(bank)
    atm = ATM(bank)
    atm.mainloop()
示例#3
0
def main(fileName = None):
    """Creates the bank with the optional file name,
    wraps the window around it, and opens the window.
    Saves the bank when the window closes."""
    if not fileName:
        bank = createBank(5)
    else:
        bank = Bank(fileName)
    print(bank)
    atm = ATM(bank)
    atm.mainloop()
示例#4
0
def main(fileName="bank.dat"):
    """Creates the bank with the optional file name,
    wraps the window around it, and opens the window.
    Saves the bank when the window closes."""
    if not fileName:
        bank = createBank(5)
    else:
        bank = Bank(fileName)
    print(bank)
    manager = BankManager(bank)
    manager.mainloop()
    bank.save()
示例#5
0
文件: atm.py 项目: Karagul/banking
def main():
    bank = createBank(5)
    print(bank)
    atm = ATM(bank)
    atm.mainloop()
示例#6
0
"""
Carl Bechie
CIS 185
ex 10.8
"""

from socket import *
from atmclienthandler import ATMClientHandler
from bank import createBank

HOST = "localhost"
PORT = 5000
ADDRESS = (HOST, PORT)

server = socket(AF_INET, SOCK_STREAM)
server.bind(ADDRESS)
server.listen(5)
bank = createBank(5)
print(bank)  # Show the account credentials for testing

# The server now just waits for connections from clients
# and hands sockets off to client handlers
while True:
    print("Waiting for connection . . .")
    client, address = server.accept()
    print("... connected from: ", address)
    handler = ATMClientHandler(client, bank)
    handler.start()