From a3fce9f7e4b0e22361385c03856cf10e3cdde5cc Mon Sep 17 00:00:00 2001 From: Lars Bogner Date: Fri, 2 Aug 2019 16:06:53 +0200 Subject: [PATCH] file saving --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 1cd7fbe..4c2dee1 100644 --- a/main.py +++ b/main.py @@ -44,7 +44,10 @@ try: user_IO.user_output(subject_get.return_average_subject) elif input_or_output == "exit": break - raise SystemError + with open(filepath, 'w') as file: + _list = [serializer.serialize(_subject) for _subject in subjects] + string = encryption.encrypt(password, str(_list)) + file.write(string) except Exception as e: print('ERROR' + str(e))