commit bf27bee3fcc5d23a08f9040adafb62dc1afcf481
Author: Данила Копылов <stud179120@vyatsu.ru>
Date:   Sun May 18 18:30:17 2025 +0300

    всё сделано

diff --git a/1week.py b/1week.py
new file mode 100644
index 0000000..08dcf10
--- /dev/null
+++ b/1week.py
@@ -0,0 +1,78 @@
+import os
+
+def get_script_dir():
+    """Возвращает директорию, где находится текущий скрипт"""
+    return os.path.dirname(os.path.abspath(__file__))
+
+def create_input_file():
+    """Создает исходный файл data.txt с тестовыми данными"""
+    script_dir = get_script_dir()
+    data_path = os.path.join(script_dir, 'data.txt')
+    
+    data = [
+        "apples\n",
+        "Bananas\n",
+        "oranges\n",
+        "Grapes\n",
+        "watermelon\n"
+    ]
+    
+    try:
+        with open(data_path, 'w') as file:
+            file.writelines(data)
+        print(f"Файл data.txt успешно создан: {data_path}")
+        return True
+    except Exception as e:
+        print(f"Ошибка при создании файла: {e}")
+        return False
+
+def process_file():
+    """Обрабатывает данные из файла и сохраняет результат"""
+    script_dir = get_script_dir()
+    input_path = os.path.join(script_dir, 'data.txt')
+    output_path = os.path.join(script_dir, 'output.txt')
+    
+    if not os.path.exists(input_path):
+        print(f"Файл не найден: {input_path}")
+        return False
+
+    try:
+        with open(input_path, 'r') as file:
+            lines = file.readlines()
+        
+        processed_lines = [line.strip().upper() for line in lines]
+        processed_lines.sort()
+
+        with open(output_path, 'w') as file:
+            file.writelines(line + '\n' for line in processed_lines)
+        
+        print(f"Файл output.txt успешно создан: {output_path}")
+        return True
+    except Exception as e:
+        print(f"Ошибка при обработке файла: {e}")
+        return False
+
+def show_results():
+    """Показывает содержимое полученного файла"""
+    script_dir = get_script_dir()
+    output_path = os.path.join(script_dir, 'output.txt')
+    
+    if not os.path.exists(output_path):
+        print(f"Файл не найден: {output_path}")
+        return
+
+    try:
+        with open(output_path, 'r') as file:
+            content = file.read()
+        print("\nСодержимое output.txt:")
+        print(content)
+    except Exception as e:
+        print(f"Ошибка при чтении файла: {e}")
+
+if __name__ == "__main__":
+    print("=== Программа обработки файлов ===")
+    print(f"Рабочая директория: {get_script_dir()}")
+    
+    if create_input_file():
+        if process_file():
+            show_results()
\ No newline at end of file
diff --git a/data.txt b/data.txt
new file mode 100644
index 0000000..d3bc555
--- /dev/null
+++ b/data.txt
@@ -0,0 +1,5 @@
+apples
+Bananas
+oranges
+Grapes
+watermelon
diff --git a/output.txt b/output.txt
new file mode 100644
index 0000000..597f518
--- /dev/null
+++ b/output.txt
@@ -0,0 +1,5 @@
+APPLES
+BANANAS
+GRAPES
+ORANGES
+WATERMELON