Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-------------------------------------------------------------------------------
- # Name: Cinema Seater 2000.0
- # Purpose: Software Assignment
- #
- # Author: Leo Carnovale
- #
- # Created: 04/08/2015
- # Copyright: (c) L.Carnovale 2015
- # Licence: Learner's Permit
- #-------------------------------------------------------------------------------
- KEY = 4
- from math import log
- def BaseConvert(number, StartBase, EndBase):
- try:
- n = int(str(StartBase)) + int(str(EndBase))
- except ValueError:
- return "Bad Base input"
- StartBase, EndBase = int(StartBase), int(EndBase)
- letters = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P']
- StartLength = len(str(number))
- for i in str(number):
- if i not in letters:
- try:
- a = int(i)
- except ValueError:
- return "Bad input"
- total = 0
- for i in range(StartLength):
- n = StartLength - i - 1
- X = str(number)[n]
- if X in letters:
- X = letters.index(X) + 10
- X = int(X)
- if X > StartBase:
- return "Bad start base"
- total += int(X) * (StartBase ** i)
- number = total
- if EndBase > 1:
- n2 = int(log(number, EndBase))
- elif EndBase == 1:
- n2 = number
- else:
- print("Unable to complete base conversion")
- return
- total = number
- numbers = []
- for i in range(n2 + 1):
- X = int(total/(EndBase ** (n2 - i)))
- if X > 9:
- X = str(X)
- numbers.append(str(X))
- total = total % EndBase ** (n2 - i)
- EndNumber = '|'.join(numbers)
- Time = EndNumber.split("|")
- if int(Time[0]) < 12:
- part = "am"
- NewTime1 = int(Time[0])
- else:
- part = "pm"
- NewTime1 = int(Time[0]) - 12
- if NewTime1 == 0:
- NewTime1 = 12
- if len(Time[1]) == 1:
- NewTime2 = "0" + Time[1]
- else:
- NewTime2 = Time[1]
- Time = str(NewTime1) + ":" + str(NewTime2) + part
- return Time
- def StripNumber(Number, Places):
- if Places == -1:
- Number = str(Number)
- count = 0
- for char in Number:
- if char != 0:
- return int(Number[count:])
- count += 1
- if type(Number) != float:
- try:
- Number = float(Number)
- except ValueError:
- return Number
- Number = str(Number)
- Decimals = Number.split(".")[1]
- Decimals = Decimals[0:Places]
- Decimals = ''.join(reversed([x for x in str(int(''.join(reversed([x for x in Decimals]))))]))
- Number = int(Number.split(".")[0])
- return str(Number) + "." + str(Decimals)
- def PrintTimeTable(cinema):
- global BaseConvert
- tab = max([len(x) for x in cinema if x[0] != "!"])
- tab = max(tab, max([len(x[0]) for x in cinema["!movies"]]))
- tab += 3
- if tab > 30:
- tab = 30
- print("Theatre:|", end = "")
- for theatre in sorted(cinema):
- if theatre[0] != "!":
- if len(theatre) > tab:
- theatre = theatre[0:27] + "..."
- print(str(theatre).ljust(tab, " "), end = "|")
- print()
- for time in sorted(cinema["!timetable"]):
- Time = BaseConvert(time, 10, 60)
- print(Time.ljust(8, "-") + "|", end = "")
- for theatre in sorted(cinema):
- if theatre[0] != "!":
- x = cinema["!timetable"][time][theatre]
- if len(x) > tab:
- x = x[0:27] + "..."
- print(x.ljust(tab, "-") +"|", end = "")
- print()
- print()
- def SeatTranslator(Number_Or_SeatLabel, Total_Seats):
- Seats = [int(x) for x in Total_Seats.split("*")]
- Seats.append(Seats[0] * Seats[1])
- alphabet = ["a", 'b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
- try:
- Number_Or_SeatLabel = int(Number_Or_SeatLabel)
- except ValueError:
- try:
- N = Number_Or_SeatLabel.split(",")[1]
- except IndexError:
- print("Seating script error")
- else:
- coord = [x for x in Number_Or_SeatLabel.split(",")]
- if coord[0].lower() in alphabet:
- coord = [alphabet.index(coord[0].lower()) + 1, coord[1]]
- coord = [int(x) for x in coord]
- for i in range(2):
- if coord[i] > Seats[i]:
- return False
- num = Seats[1] * (coord[0] - 1) + coord[1]
- return num
- else:
- num = Number_Or_SeatLabel
- col = num % Seats[1]
- row = int(num / Seats[1]) + 1
- if Seats[0] <= 26:
- row = alphabet[row - 1]
- coord = [str(row), str(col)]
- return coord
- def get_input(prompt,typ, bad_input,good_input):
- if good_input:
- SpecGood = True
- else:
- SpecGood = False
- Sign = ""
- if bad_input:
- SpecBad = True
- if typ == int or typ == float:
- if bad_input[0] == "-":
- Sign = 1
- elif bad_input[0] == "+":
- Sign = -1
- else:
- SpecBad = False
- go = True
- while go:
- inp = input(prompt)
- try:
- inp = typ(inp)
- except ValueError:
- continue
- else:
- if SpecGood:
- if inp in good_input:
- if SpecBad:
- if inp not in bad_input:
- go = False
- else:
- go = False
- else:
- go = False
- if Sign and inp != 0:
- if abs(inp) / inp != Sign:
- go = True
- return inp
- def EncryptInt(String, Key):
- x = str(String)
- x = [ord(i) for i in x]
- Key = int(Key)
- c = ''.join([chr((int(i if i != 10 else 11) ** Key) % 128) for i in x])
- return c
- def Input2Coords(Input):
- if "," in Input:
- coords = Input
- else:
- coords = Input[0] + "," + Input[1:]
- return coords
- def SignIn():
- global Member
- global KEY
- print("Enter your pin number:")
- pin_enter = get_input(">>> ", str, [], [])
- for member in members:
- pin = EncryptInt(pin_enter, KEY)
- if pin == members[member][0]:
- print("Welcome {}!".format(member))
- Member = member
- if not Member:
- print("User not found, please try again.")
- def AddMember(Name, Pin):
- global KEY
- global EncryptInt
- global members
- Pin = EncryptInt(Pin, KEY)
- members[Name] = [Pin]
- def AddSessionToMember(member, session): # [Password, [<Session number>, Seat1, Seat2, Seat3, ..., SeatN]]
- members[member].append(session)
- def UpdateMembers():
- f = open("members.rtf", "w")
- for member in members:
- line = member + ", " + members[member][0]
- if len(members[member]) > 1:
- line += ", " + str(members[member][1])
- line += "\n"
- f.write(line)
- f.close()
- def MakeTimetable():
- for cinema in cinemas_all:
- sessions = [] #Sessions{[Movie, theatre, start time, end time, [seats])
- TimeTable = {}# seats: [A[1, 2, 3, 4, ...], B[1, 2, 3, ...]]
- Theatres = [theatre for theatre in cinemas_all[cinema] if theatre[0] != "!"]
- for i in range(540, 1381, 5):
- if len(str(i)) == 3:
- i = '0' + str(i)
- TimeTable[str(i)] = {}
- for theatre in Theatres:
- TimeTable[str(i)][theatre] = ""
- N_Theatres = len(cinemas_all[cinema]) - 2
- N_Movies = len(cinemas_all[cinema]["!movies"])
- Movies = [movie[0] for movie in cinemas_all[cinema]["!movies"]]
- count = 0
- for theatre in Theatres:
- if count >= N_Movies:
- count = 0
- TimeTable['0540'][theatre] = Movies[count]
- for time in range(540, 545 + cinemas_all[cinema]["!movies"][count][1], 5):
- if len(str(time)) == 3:
- time = '0' + str(time)
- TimeTable[str(time)][theatre] = Movies[count]
- sessions.append([Movies[count], theatre, '0540', time, cinemas_all[cinema][theatre][1],[]])
- count += 1
- for time in sorted(TimeTable):
- for theatre in TimeTable[time]:
- time_in_20 = str(int(time) + 20)
- if int(time_in_20) >= 1380:
- time_in_20 = time
- if len(time_in_20) == 3:
- time_in_20 = "0" + str(time_in_20)
- if TimeTable[time][theatre] == "" and TimeTable[time_in_20][theatre] == "":
- start = count
- skip = False
- if count >= N_Movies:
- count = 0
- while 1360 - cinemas_all[cinema]["!movies"][count][1] < int(time):
- if count == start:
- skip = True
- break
- count += 1
- if count >= N_Movies:
- count = 0
- if not skip:
- if TimeTable[str(time)][theatre] == "":
- for Ttime in range(int(time) + 20, int(time) + cinemas_all[cinema]["!movies"][count][1] + 20, 5):
- if len(str(Ttime)) == 3:
- Ttime = '0' + str(Ttime)
- TimeTable[str(Ttime)][theatre] = Movies[count]
- sessions.append([Movies[count], theatre, time, Ttime, cinemas_all[cinema][theatre][1] ,[]])
- count += 1
- if count >= N_Movies:
- count = 0
- cinemas_all[cinema]["!timetable"] = TimeTable
- cinemas_all[cinema]["!sessions"] = sessions
- print("flag!!")
- for session in sessions:
- new_session = [cinema]
- for p in session:
- new_session.append(p)
- sessions_all.append(new_session)
- # Session--> N:[Cinema, Movie name, Theatre, Start Time, End Time, Seat type, [Used Seats]]
- f = open("timetable.txt","w")
- for session in sessions_all:
- line = str(sessions_all.index(session)) + "::" + str(session)
- f.write(line)
- f.write("\n")
- f.close()
- def ParseToArray(ArrayAsString):
- ArrayAsString = ArrayAsString.strip()
- NewArray = []
- ##AllParts = ArrayAsString.split(",")
- level = -1
- ##First = True
- InString = False
- count = 0
- index = 0
- index_start = 0
- ##index_end = 0
- for Char in ArrayAsString: # Goes through each character, if a ' is found, InString = 1, if a " is found, InString = 2,
- if Char == "[" and InString == 0: # If InString is not 0, then brackets will be ignored.
- level += 1
- if level == 1:
- Start = count
- elif Char == "]" and InString == 0:
- level -= 1
- if level == 0:
- End = count
- NewArray.append(ParseToArray(ArrayAsString[Start:End + 1]))
- index_start = count + 1
- ## continue
- elif Char == "'":
- if InString == 1:
- InString = 0
- elif InString == 0:
- InString = 1
- elif Char == '"':
- if InString == 2:
- InString = 0
- elif InString == 0:
- InString = 2
- if level == -1 and Char == "]" and InString == 0 and index_start != count:
- index += 1
- NewArray.append(ArrayAsString[index_start + 1:count].strip())
- index_start = count
- if level == 0 and Char == "," and InString == 0 and index_start != count:
- index += 1
- NewArray.append(ArrayAsString[index_start + 1:count].strip())
- index_start = count
- count += 1
- ## count = 0
- ## for item in NewArray:
- ## if item:
- ## if item.strip()[0] == item.strip()[-1]:
- ## if item[0] == "'" or item[0] == '"':
- ## NewArray[count] = str(item[1:-1])
- NewArray = CleanUp(NewArray)
- return NewArray
- def CleanUp(Mess):
- count = 0
- for item in Mess:
- if item:
- if type(item) == list:
- Mess[count] = CleanUp(item)
- elif item.strip()[0] == item.strip()[-1]:
- if item[0] == "'" or item[0] == '"':
- Mess[count] = str(item[1:-1])
- count += 1
- Clean = Mess
- return Clean
- def ReadTimetable():
- print("Starting (0)")
- global sessions_all
- try:
- with open("timetable.txt","r") as f:
- print("Starting (1)")
- for line in f:
- if line:
- array = line.split("::")[1]
- sessions_all.append(ParseToArray(array))
- print("Done (1)")
- print("Starting (2)")
- for cinema in cinemas_all:
- cinemas_all[cinema]["!sessions"] = []
- print("Done (2)")
- print("Starting (3)")
- for session in sessions_all:
- cinema = session[0]# Session--> N:[Cinema, Movie name, Theatre, Start Time, End Time, Seat type, [Used Seats]]
- cinemas_all[cinema]["!sessions"].append(session[1:])
- print("Done (3)")
- print("Starting (4)")
- for cinema in cinemas_all:
- data = cinemas_all[cinema]
- cinemas_all[cinema]["!timetable"] = {}
- print("Starting (5)")
- ## for session in data["!sessions"]:
- RUNNING = [] #[[Name, Theatre]]
- print("Starting (6)")
- for i in range(540, 1381, 5):
- print("Starting (7)")
- for session in data["!sessions"]:
- if int(StripNumber(session[2], -1)) == i:
- RUNNING.append([session[0], session[1]])
- if len(str(i)) == 3:
- time = '0' + str(i)
- else:
- time = str(i)
- cinemas_all[cinema]["!timetable"][time] = {}
- for Movie in RUNNING:
- ## print("Starting (8)")
- cinemas_all[cinema]["!timetable"][time][Movie[1]] = Movie[0]
- if int(StripNumber(session[3], -1)) == i:
- RUNNING.remove([session[0], session[1]])
- print("Done (5-8)")
- print("Done (4)")
- except FileNotFoundError:
- print("The file doesn't exist, but I tried looking for it anyway. I shouldn't\nhave done that and you shouldn't bee seeing this but oh well.")
- except ValueError:
- print("A ValueError occured, meaning I found some letters where ther should be nuimbers.\nThe timetable file is probably corrupt. If you can't fix it, delete the timetable file.")
- except IndexError:
- print("Index Flag!")
- print("Done (0)")
- # ######################################################################################################################################################################################################
- # Log book: https://docs.google.com/document/d/1w21Rvb-Z3PomSWipWrbKzBwybN_JN6yUL4h8mY5CD2s/edit?usp=sharing
- print("Cinema Seater 2000.0")
- print("Loading cinemas...")
- import glob, os
- rates = {}# Rates: {Ticket: Price, ...}
- cinemas_list = []
- cinemas_all = {}# Cinemas: {Cinema: [Movies: [[movie 1, length], [movie 2, length], ...], Theatre 1: [N.of seats, Seats type], Theatre 2: [.., ..], ..., Seats: [[seat type, percentage], ...], ...}
- for file in glob.glob("*.txt"):
- if file != "rates.txt":
- cinemas_list.append(file)
- else:
- f = open(file, 'r')
- ratesFILE = f.read()
- f.close()
- for rate in ratesFILE.split("\n"):
- try:
- if rate:
- ticket = rate.split("=")[0].strip()
- price = rate.split("=")[1].strip()
- rates[ticket] = int(price)
- except ValueError:
- print("Rates file not formatted correctly. Please create one before using the program.")
- ##theatres_sorted = {} #[cinema[theatre, ...]]
- print("Organising Data...")
- for cinema in cinemas_list: #Goes through cinemas in directory and loads movies and seats into cinemas_all
- f = open(cinema, "r")
- name = cinema[:-4]
- FILE = f.read()
- f.close()
- CINEMA = {}
- cont = False
- if FILE[0:17].lower() != "available movies:":
- continue
- else:
- SplitFILE = FILE.split(";")
- CINEMA["!movies"] = []
- CINEMA["!prices"] = {}
- for movie in SplitFILE[1].split("\n"):# Loads movies into temp CINEMA["!movies"] ( = [...])
- if movie:
- try:
- length = movie.split(",")[1]
- length = length.strip()
- movie = movie.split(",")[0]
- if movie[0] == '"' and movie[-1] == '"':
- length = int(length)
- CINEMA["!movies"].append([movie[1:-1], length])
- except IndexError:
- print("'" + cinema + "'" + " is not formatted correctly! (Available movie list, IndexError)")
- cont = True
- break
- except ValueError:
- print("'" + cinema + "'" + " is not formatted correctly! (Available movie list, ValueError)")
- cont = True
- break
- if cont:
- cont = False
- continue
- for theatre in SplitFILE[3].split("\n"):# Loads seats into temp CINEMA[<theatre>] ( = [N. of seats, seats type])
- if theatre:
- try:
- theatre_name = theatre.split(") ")[0]
- NumSeats = theatre.split(" ")[1]
- seat_type = theatre.split(", ")[1]
- CINEMA[theatre_name] = [NumSeats, seat_type]
- except IndexError:
- print("'" + cinema + "'" + " is not formatted correctly! (Theatres list, IndexError)")
- cont = True
- break
- except ValueError:
- print("'" + cinema + "'" + " is not formatted correctly! (Theatres list, ValueError)")
- cont = True
- break
- if cont:
- cont = False
- continue
- for seat in SplitFILE[5].split("\n"):
- try:
- if seat:
- seat_price = seat.split("= ")[1][:-1]
- seat_name = seat.split("=")[0].strip()
- seat_price = float(seat_price)
- CINEMA["!prices"][seat_name] = seat_price/100
- except IndexError:
- print("'" + cinema + "'" + " is not formatted correctly! (Prices, IndexError)")
- cont = True
- break
- except ValueError:
- print("'" + cinema + "'" + " is not formatted correctly! (Prices, ValueError)")
- cont = True
- break
- if cont:
- cont = False
- continue
- cinemas_all[name] = CINEMA
- # All cinemas, movies, seats and rates are loaded.
- for cinema in cinemas_all:
- for movie in cinemas_all[cinema]["!movies"]:
- A = movie
- for Bcinema in cinemas_all:
- for Bmovie in cinemas_all[Bcinema]["!movies"]:
- B = Bmovie
- if A[0] == B[0] and A[1] != B[1]:
- print("The movie '%s' occurs in more than one place with different time lengths.\nPlease ensure that both have the same name and time length if they are the same movie.\nIf they are different movies, make sure the names are different.\nThey will excluded from the program until fixed." %(A[0]))
- cinemas_all[cinema]["!movies"].remove(A)
- cinemas_all[Bcinema]["!movies"].remove(B)
- # Organising Timetable for movies:
- print("Organising a timetable...")
- sessions_all = []
- try:
- f = open("timetable.txt", "r")
- ## ###############################################################
- ## #
- ## (Really Big Obvious Bookmark kinda thing) #
- ## #
- ## ###############################################################
- except FileNotFoundError:
- MakeTimetable()
- else:
- ReadTimetable()
- members = {}
- # Load Members
- try:
- with open("members.rtf","r") as f:
- for line in f:
- if not line.strip():
- continue
- parts = line.split(",")
- name = parts[0].strip(' ')
- pas = parts[1].strip(' ')
- members[name] = [pas]
- except FileNotFoundError:
- print("Members file not found, making new one.")
- f = open("members.rtf","w")
- f.close()
- # Everything is sorted by now
- print("Ready!")
- # ###########################################################
- print("\n")
- choice = -1
- Member = False
- while choice != 0:
- print("What would you like to do?:")
- print("0) Exit")
- print("1) Book a movie")
- print("2) Look at session times")
- print("3) Settings")
- if Member:
- print("4) Review movies/Sign out")
- else:
- print("4) Sign in as Member")
- print("Enter a number:")
- choice = get_input(">>> ", int, [-1], [0, 1, 2, 3, 4])
- if choice == 1:# Choosing a movie #################
- searching = True
- while searching:
- print("Enter a search term to search for movies, or leave blank to show all movies")
- search = input(">>> ")
- if search:
- results = []
- for cinema in cinemas_all:
- for movie in cinemas_all[cinema]["!movies"]:
- if search.lower() in movie[0].lower() and movie[0] not in results:
- results.append(movie[0])
- if results:
- count = 1
- for result in results:
- print(str(count) + ")", result)
- count += 1
- print("Enter the number of the movie to select it or enter 0 to search again:")
- movie_choice = get_input(">>> ", int, [-1], [x for x in range(count + 1)])
- if movie_choice != 0:
- searching = False
- movie_choice = results[movie_choice - 1]
- else:
- print("No results found")
- else:
- for cinema in sorted(cinemas_all):
- print(cinema + ":")
- for movie in cinemas_all[cinema]["!movies"]:
- print("\t" + movie[0] + " (" + str(movie[1]) + " mins)")
- # Movie name chosen
- available_cinemas = []
- for cinema in cinemas_all:
- for movie in cinemas_all[cinema]["!movies"]:
- if movie[0] == movie_choice:
- available_cinemas.append(cinema)
- if len(available_cinemas) == 1:
- print("Your movie is currently only available in '%s', please select a time to continue." %(available_cinemas[0]))
- cinema_choice = available_cinemas[0]
- else:
- print("Your movie is available in the following cinemas:")
- count = 1
- for cinema in sorted(available_cinemas):
- print("\t" + str(count) + ")", cinema)
- count += 1
- print("Choose one:")
- cinema_choice = sorted(available_cinemas)[get_input(">>> ", int, [-1], [int(x) for x in range(1, len(available_cinemas) +1)]) - 1]
- print(cinema_choice)
- count = 1
- available_sessions = []
- for session in cinemas_all[cinema_choice]["!sessions"]:
- if session[0] == movie_choice:
- print("%i) %s - %s (theatre: %s, %s seats)" %(count, BaseConvert(session[2], 10, 60), BaseConvert(session[3], 10, 60), session[1], session[4]))
- count += 1
- available_sessions.append(session)
- session_choie = get_input(">>> ", int, [-1],[x for x in range(1, count)])
- session_choie -= 1
- session_choie = available_sessions[session_choie]
- # If member, Prices are all at 80%
- if not Member:
- print("Are you a member? (Y/N): ")
- if_member = get_input(">>> ", str, [], ["y","Y","yes","Yes","no","No","n","N"])
- if if_member in ["y","Y","yes","Yes"]:
- SignIn()
- else:
- print("Sign up as a member for discounts on all your movies!")
- print("Choose tickets:")
- count = 0
- session_rates = [rates[x] * cinemas_all[cinema_choice]["!prices"][session_choie[4]] for x in sorted(rates)]
- cost = 0
- tickets = 0
- for rate in sorted(rates):
- Price = rates[rate] * cinemas_all[cinema_choice]["!prices"][session_choie[4]]
- if Member:
- Price = Price * 0.8
- print("%s, $%s" %(rate, StripNumber(Price, 2)))
- quant = get_input("Quantity: ", int, ["-"], [])
- cost += quant * session_rates[count]
- tickets += quant
- count += 1
- print("Total: %f" %(cost))
- print("Choose your seats: ")
- Seat_Area = [x for x in cinemas_all[cinema_choice][session_choie[1]][0].split("*")]
- nRows = int(Seat_Area[0])
- nCols = int(Seat_Area[1])
- nSeats = nRows * nCols
- print(" " + "Screen".center(nCols * 3, "-"))
- print(" " + ''.join([str(x+1).ljust(3, " ") for x in range(nCols)]))
- number = 1
- for seatR in range(1, nRows + 1):
- print(" " + SeatTranslator(number, "*".join(Seat_Area))[0].upper(), end = ' ')
- for seatC in range(1, nCols + 1):
- if number in session_choie[5]:
- print(" X ", end = "")
- else:
- print(" O ", end = "")
- number += 1
- print()
- print("You have {0} ticket(s), please select {0} seat(s):".format(tickets))
- ## chosen_seats = []
- print("To choose seats, type in either letter-number coordinates (eg. A3, H4),\nor if the rows are numbered (and not lettered) use Row,Column (eg. 1,3 or 15,21) ")
- selected_seats = []
- for i in range(tickets):
- seat_choice = SeatTranslator(Input2Coords(get_input(">>> ", str, [], [])), "{}*{}".format(nRows, nCols))
- while not seat_choice or seat_choice in session_choie[5]:
- if not seat_choice:
- print("Invalid seat number")
- elif seat_choice in session_choie[5]:
- print("Seat is already taken. Please choose another.")
- seat_choice = SeatTranslator(Input2Coords(get_input(">>> ", str, [], [])), "{}*{}".format(nRows, nCols))
- session_choie[5].append(seat_choice)# Lookie Lookie
- selected_seats.append(seat_choice - 1)
- if Member:
- SessionToAdd = [sessions_all.index([cinema_choice] + session_choie)]
- for seat in selected_seats:
- SessionToAdd.append(seat)
- AddSessionToMember(Member, SessionToAdd)
- elif choice == 4:
- if Member:
- print("Sign out? (Y/N)")
- confirm = get_input(">>> ", str, [], ["y","Y","yes","Yes","no","No","n","N"])
- if confirm in ["y","Y","yes","Yes"]:
- print("Signing out, catchya later {}.".format(Member))
- Member = False
- else:
- if_member = get_input("Are you a member? (Y/N) ", str, [], ["y","Y","yes","Yes","no","No","n","N"])
- if if_member in ["y","Y","yes","Yes"]:
- SignIn()
- else:
- print("Enter your details, becoming a member is free, quick and easy and only costs $35.99!!")
- nam = get_input("Username: ",str, [], [])
- while nam in members:
- print("Username is being used, please select a different one")
- nam = get_input("Username: ",str, [], [])
- pin = get_input("Pin number (at least 4 digits): ", int, [], [])
- while len(str(pin)) < 4:
- print("Pin must be at least 4 digits.")
- pin = get_input("Pin number: ", int, [], [])
- members[nam] = str(pin)
- AddMember(nam, pin)
- elif choice == 3:
- print("Settings:")
- print("")
- elif choice == 2:
- print("Printing times for all cinemas:")
- for cinema in cinemas_all:
- print("Cinema:", cinema)
- PrintTimeTable(cinemas_all[cinema])
- UpdateMembers()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement