From f8548c8b276e3011936d450006b03830d03643c8 Mon Sep 17 00:00:00 2001 From: 1826013250 <62735351+1826013250@users.noreply.github.com> Date: Sun, 17 Jul 2022 18:55:24 +0800 Subject: [PATCH] Update main.py to optimize just one thing replaced the "return" with "exit" function --- main.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index c1ede07..23bf108 100644 --- a/main.py +++ b/main.py @@ -1,10 +1,9 @@ #!/usr/bin/env python3 +# ↑ For Linux & MacOS to run this program directly if the user currently installed python and third-party packages. # -*- coding: utf-8 -*- -# author David-123 +# author: David-123 -import os - from modules.raw_input import rinput from modules.information import print_info from modules.multi_download import mdl @@ -15,10 +14,8 @@ from modules.clear_screen import clear class MainProcess(object): - def __init__(self): + def __init__(self): # 项目初始化 self.settings = load_settings() - if not os.path.exists(self.settings.lyric_path): - os.mkdir(self.settings.lyric_path) self.version = "0.0.0" def mainloop(self): @@ -35,7 +32,7 @@ class MainProcess(object): elif r == "2": mdl(self.settings.lyric_path) elif r == "0": - break + exit(0) elif r == "i": print_info(self) elif r == "s":