From b704c7ddda19de74e756855a9a50cad72a88a3fb Mon Sep 17 00:00:00 2001 From: ben05allen Date: Sun, 15 Oct 2023 20:04:25 +0900 Subject: [PATCH] cls else clear --- CS_Source Code.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CS_Source Code.py b/CS_Source Code.py index ab333ba..c394979 100644 --- a/CS_Source Code.py +++ b/CS_Source Code.py @@ -180,6 +180,7 @@ def delete_roll(): os.rename("temp.dat", "stud.dat") input("Press any key to continue....") + if not os.path.isfile("stud.dat"): print("'stud.dat' file doesn't exist.") print("1 -> Generate a new empty file") @@ -188,7 +189,7 @@ def delete_roll(): print(40 * "=") choice = input("Enter your choice: ") print(40 * "=") - + if choice == "1": try: file = open("stud.dat", "wb") @@ -206,7 +207,7 @@ def delete_roll(): while True: - os.system("cls") + os.system("cls" if os.name == "nt" else "clear") print(40 * "=") print( """ Main Menu