def ENCODING(KEY):
log = logging.getLogger("Error")
logging.basicConfig(filename="Errors.log", level=logging.INFO)
try:
ENCODE_KEY = base64.b64encode(bytes(str(KEY), 'ascii'))
global FILE_NAME
with open(FILE_NAME, "w") as wf:
wf.write(str(ENCODE_KEY))
except Exception:
log.exception("def ENCODING(KEY)")
VALIDATOR_KEY()
import base64
from os.path import isfile
#key = "XXX-XXX-XXX"
def write_encode_key():
f_name = "key.key"
encode_key = "b'WFhYLVhYWC1YWFg='"
check_file = isfile(f_name)
if check_file == True:
db = open("key.key", "rb")
encoded_key = db.read()
db.close()
if encoded_key == encode_key:
pass
else:
db = open("key.key", "wb")
db.write(encode_key)
db.close()
write_encode_key()
else:
with open(f_name, "w") as db:
db.write(str(encode_key))
write_encode_key()
write_encode_key()
#with open("key.key", "r") as db:
# encoded_key = db.read()
# decoding_key = base64.b64encode(encoded_key.encode()).decode()
# print(decoding_key)
File "C:\Users\Ternick\Desktop\1.py", line 12
encoded_key = db.read()
^
IndentationError: unexpected indent