from flask import Flask from delivery import * app = Flask(__name__) @app.route("/") class Main(): def StartMessage(self): while True: print(''' Welcome to The Toy Store Please select which action you would like: 1. View store products 2. Add item to Shopping Cart 3. View Shopping Cart 4. Remove item from Shopping Cart 5. Calculate Shopping Cart 6. Checkout 7. Delivery 8. Check product availability 9. Exit ''') selection = int(input("Select which action: ")) if selection == 1: Products.listProducts(self) elif selection == 2: ShoppingCart.add_products(self) elif selection == 3: ShoppingCart.displayCart(self) elif selection == 4: ShoppingCart.removeitem(self) elif selection == 5: ShoppingCart.totalprice(self) elif selection == 6: Delivery.checkout(self) elif selection == 7: ShoppingCart.postage(self) elif selection == 8: ShoppingCart.check_stock(self) elif selection == 9: print(" Thank you for visiting The Toy Store, we hope to see you again") break else: print("Invalid selection, please try again") break startmessage = Main() startmessage.StartMessage()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)