From a3dcff3a55095986150d827ec773b8f0acf4fa77 Mon Sep 17 00:00:00 2001 From: hyperbel Date: Sat, 5 Nov 2022 11:39:40 +0100 Subject: [PATCH] save file directly, instead of moving it there after creating it --- main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 6804447..3bda533 100644 --- a/main.py +++ b/main.py @@ -65,9 +65,7 @@ def warning_log(warning): if not os.path.exists("./static/img/qr.png"): img = qrcode.make('127.0.0.1:5000') type(img) - img.save("qr.png") - ort = "./static/img" - shutil.move("qr.png", ort) + img.save("./static/img/qr.png") else: warning_log("QR-Code ist bereits vorhanden") @@ -349,4 +347,4 @@ def page_not_found(e): def create_app(config_filename): app.register_error_handler(404, page_not_found) log_server("created app") - return app \ No newline at end of file + return app