From b757fbfb5111a13d189c40de17ea736f36d7503b Mon Sep 17 00:00:00 2001 From: AginS Date: Wed, 30 Oct 2019 09:55:25 +0300 Subject: [PATCH] Now time of life code is visible --- CodesEditor.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CodesEditor.py b/CodesEditor.py index 4155ca8..55fe96c 100644 --- a/CodesEditor.py +++ b/CodesEditor.py @@ -10,6 +10,13 @@ import FileWork as fw ### My fucntions here starts +def getTime(): + time_last = int(time.strftime("%S")) + if time_last>=30: + time_last = time_last - 30 + time_last = 30 - time_last + return ("(You have %s seconds left) " % str(time_last)) + def help(): teer() print("1 - add\n2 - del\n3 - change\n4 - get\n\n9 - exit") @@ -62,6 +69,7 @@ def get(codes): if service_name in codes: secure_code = codes[service_name] totp = pyotp.TOTP(secure_code) + print( getTime() ) print(service_name + ": " + totp.now()) teer()