Prettify output.
This commit is contained in:
parent
820936ae98
commit
ce7286545b
@ -35,7 +35,7 @@ def get_data(conn):
|
|||||||
:param conn: Connection object
|
:param conn: Connection object
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
id = int(input("Please enter student ID: "))
|
id = int(input("\nPlease enter student ID: "))
|
||||||
|
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
cur.execute("SELECT id, student_class, other FROM students")
|
cur.execute("SELECT id, student_class, other FROM students")
|
||||||
@ -51,7 +51,7 @@ def get_data(conn):
|
|||||||
else:
|
else:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print("Invalid ID, try again.")
|
print("\nInvalid ID, try again.")
|
||||||
return get_data(conn)
|
return get_data(conn)
|
||||||
|
|
||||||
|
|
||||||
@ -139,9 +139,9 @@ def main():
|
|||||||
current_time = parse_time_string(time.strftime("%H:%M"))
|
current_time = parse_time_string(time.strftime("%H:%M"))
|
||||||
|
|
||||||
if finish_time == None:
|
if finish_time == None:
|
||||||
print("Student has no lessons today, clear to leave.")
|
print("\nStudent has no lessons today, clear to leave.")
|
||||||
elif finish_time < current_time:
|
elif finish_time < current_time:
|
||||||
print("Student has finished for today, clear to leave.")
|
print("\nStudent has finished for today, clear to leave.")
|
||||||
else:
|
else:
|
||||||
print("\nStudent still has lessons, clearance not granted.")
|
print("\nStudent still has lessons, clearance not granted.")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user