def main(): Base.metadata.create_all(engine) arena = Cinema() while True: command = input(">>>") if command == 'add_movie': arena.add_movie() elif command == 'add_projection': arena.add_projection() elif command == 'add_reservation': arena.add_reservation() elif command == 'show_movies': arena.show_movies() elif command == 'show_movie_projections': arena.show_movie_projections(1, '2014-03-22')
def main(): engine = create_engine("sqlite:///cinema.db") base.Base.metadata.create_all(engine) session = Session(bind=engine) cinema = Cinema(session) print_menu() command = input("Enter your choice: ") put = command.split(" ") while put[0] != "end": if put[0] == "add_movie" or put[0] == '1': cinema.add_movie() if put[0] == "show_movies" or put[0] == '2': cinema.show_movies() if put[0] == "add_projection" or put[0] == '3': cinema.add_projections() if put[0] == "show_movie_projections": cinema.show_movie_projections(put[1]) if put[0] == "make_reservation" or put[0] == '5': #ENTER INFORMATION FOR USER try: #USER INFORMATION user_info = step_one(cinema) #CHOOSING MOVIE movie_choice = step_two(cinema) # CHOOSING PROJECTIONS projection_choice = step_three(cinema) # CHOOSING SEATS step_four(cinema, user_info, projection_choice, movie_choice) # FINALIZE step_five(cinema, user_info, projection_choice) except GiveUpError: print("You just give up the reservation!") print_menu() if put[0] == "cancel_reservation": cinema.cancel_reservation(put[1]) if put[0] == "exit": break if put[0] == "help": cinema.print_menu() command = input("Enter your choice: ") put = command.split(" ")
def main(): engine = create_engine("sqlite:///cinema.db") base.Base.metadata.create_all(engine) session = Session(bind=engine) cinema = Cinema(session) print_menu() command = input("Enter your choice: ") put = command.split(" ") while put[0] != "end": if put[0] == "add_movie" or put[0] == '1': cinema.add_movie() if put[0] == "show_movies" or put[0] == '2': cinema.show_movies() if put[0] == "add_projection" or put[0] == '3': cinema.add_projections() if put[0] == "show_movie_projections": cinema.show_movie_projections(put[1]) if put[0] == "make_reservation" or put[0] == '5': #ENTER INFORMATION FOR USER try: #USER INFORMATION user_info = step_one(cinema) #CHOOSING MOVIE movie_choice = step_two(cinema) # CHOOSING PROJECTIONS projection_choice = step_three(cinema) # CHOOSING SEATS step_four(cinema, user_info, projection_choice, movie_choice) # FINALIZE step_five(cinema, user_info, projection_choice) except GiveUpError: print("You just give up the reservation!") print_menu() if put[0] == "cancel_reservation": cinema.cancel_reservation(put[1]) if put[0] == "exit": break if put[0] == "help": cinema.print_menu() command = input("Enter your choice: ") put = command.split(" ")