# myApplication.py MAIN RUNTIME CLASS # importing modules to our file # ModuleName is the FileName without the py extension # Example filename: Chapter4.py # Modulenane: Chapter4 # import Chapter2 # import Module from Chapter4 import userInputs, fullName, generateSeqID # from Module import Object(s) # import Chapter3 as C3 # import Module as Alias/Namespace import Chapter5 import Chapter7 import Chapter11Mod # Namespace / Alias to import a Module import myTemplateParts as tp # Namespace import Chapter6 as c6 # Web Application Framewords -> Flask # Chapter2.firstName.lower().strip() # C3.vipStatus # fullName() calling the object directly from the import # main() function in Python # page 108/109 def main(): tp.appHeader() # Call the userInput function and assign variables # Bob, Smith varfirstName, varlastName, varmiddleName = userInputs() # Bob Smith # Call the fullname function and pass the args to the params fullName(varfirstName,varlastName, varmiddleName) # Assign a random sequence id to the contact record contactID = generateSeqID() # return of 100001,999999 print(contactID) # Products tp.productsMenu() # Add the binding from the menu selection to the function call # 1. printproducts() # 2. addProducts() c6.userAddProduct() # Add to Cart # Chapter 5 calculator function Chapter5.cartTotalCalc() # Process Daily Orders listOrders = Chapter7.orders # List of orders in memory Chapter7.export_orders_to_csv(listOrders) # Process Credit Card c6.creditCardProc() Chapter11Mod.log_error("200","Bad Request") # Log Errors Chapter11Mod.log_error("404", "Page Not Found") Chapter11Mod.log_error("500", "Server Error") # Print Orders from CSV Chapter7.read_orders_from_csv() # Runtime Application if __name__ == "__main__": # name="main" Property main()