Use raw_input instead of input

This commit is contained in:
Titouan Vervack 2018-03-08 23:22:51 +01:00
parent 0ff7dca664
commit 8567d17bab

View file

@ -14,7 +14,7 @@ def commit():
def check_if_overwrite():
answer = input("Do you want to overwrite the previous database? (y/N) ")
answer = raw_input("Do you want to overwrite the previous database? (y/N) ")
return answer in yes
@ -25,9 +25,9 @@ def add_all():
def recreate_from_scratch():
confirmation = "Are you very very sure? (Will delete previous entry's!) (y/N) "
confirmation = "Are you very very sure? (Will delete previous entries!) (y/N) "
check = "I acknowledge any repercussions!"
if input(confirmation) in yes and input("Type: '{}' ".format(check)) == check:
if raw_input(confirmation) in yes and raw_input("Type: '{}' ".format(check)) == check:
print("Resetting the database!")
db.drop_all()
db.create_all()
@ -40,9 +40,9 @@ def add_to_current():
def add_numbers():
return " ".join(["{}({}), ".format(loc, i) for i, loc in enumerate(available)]).rstrip(", ")
while input("Do you still want to add something? (Y/n) ") not in no:
while raw_input("Do you still want to add something? (Y/n) ") not in no:
print("What do you want to add? (Use numbers, or A for all, or C for chancel) ")
answer = input("Available: {} : ".format(add_numbers()))
answer = raw_input("Available: {} : ".format(add_numbers()))
if answer == "A":
add_all()
available = []