From 9f5ce4ce35c7a0e20ed6c045a5a98fd5b7f329b1 Mon Sep 17 00:00:00 2001 From: Crimson Hawk Date: Mon, 13 May 2024 11:27:07 +0800 Subject: [PATCH] added read password for admin --- libexam.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libexam.py b/libexam.py index 7f3c018..0b70ac3 100644 --- a/libexam.py +++ b/libexam.py @@ -58,6 +58,7 @@ class libexam: username = "" questions = [] + password = -1 def setmode(modein): mode=modein @@ -75,6 +76,12 @@ class libexam: print(f"Username set to: {user}\n") return 0 + def setadmin(): + passwordf = open("password.txt", "r") + password = passwordf.readline() + print(f"Read password: {password}\n") + return 0 + def readquestions(): sha256=hashlib.sha256()