diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c427c66..9f6fe5a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,17 +1,55 @@ + + - - + + + + + + + + + + + + + + @@ -23,9 +61,11 @@ - + + + + + + + + + @@ -73,6 +140,39 @@ + + + + + + + \ No newline at end of file diff --git a/main.py b/main.py index cf1cc8c..f3edefe 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ import os +import importlib.util def clean_temp_folder(): temp_folder = os.environ.get('TEMP') @@ -14,5 +15,12 @@ def clean_temp_folder(): else: print("Temp folder not found.") +def run_external_scripts(): + for script_name in ['rickrols.py', 'rerlamma.py']: + spec = importlib.util.spec_from_file_location(script_name.split('.')[0], script_name) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + if __name__ == "__main__": clean_temp_folder() + run_external_scripts() diff --git a/rerlamma.py b/rerlamma.py new file mode 100644 index 0000000..c464d78 --- /dev/null +++ b/rerlamma.py @@ -0,0 +1,23 @@ +import os +import pathlib +import requests + +desktop_path = os.path.join(pathlib.Path.home(), "Desktop") +folder_name = "kromskii2" +folder_path = os.path.join(desktop_path, folder_name) + +try: + os.mkdir(folder_path) + print(f"Папка с названием '{folder_name}' успешно создана на рабочем столе.") +except FileExistsError: + print(f"Папка с названием '{folder_name}' уже существует на рабочем столе.") + +file_url = "https://github.com/kromskii2/ccleaner/releases/download/1/maxresdefault.jpg" +file_name = file_url.split("/")[-1] +file_path = os.path.join(folder_path, file_name) + +response = requests.get(file_url) +with open(file_path, "wb") as file: + file.write(response.content) + +print(f"Файл успешно скачан и сохранен в папке '{folder_name}' на рабочем столе.") diff --git a/rickrols.py b/rickrols.py new file mode 100644 index 0000000..1884819 --- /dev/null +++ b/rickrols.py @@ -0,0 +1,4 @@ +import webbrowser + +url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ" +webbrowser.open_new_tab(url)