Загрузить файлы в «/»

This commit is contained in:
Виктория Янактаева 2025-03-06 19:20:59 +00:00
parent 90ddb0e565
commit e941f1957a
2 changed files with 26 additions and 0 deletions

6
requirements.txt Normal file
View File

@ -0,0 +1,6 @@
numpy==2.2.3
pandas==2.2.3
python-dateutil==2.9.0.post0
pytz==2025.1
six==1.17.0
tzdata==2025.1

20
script.py Normal file
View File

@ -0,0 +1,20 @@
def main():
input_file = 'data.txt'
output_file = 'output.txt'
try:
with open(input_file, 'r', encoding='utf-8') as file:
lines = file.readlines()
except FileNotFoundError:
print(f"Файл {input_file} не найден.")
return
transformed_lines = [line.upper() for line in lines]
with open(output_file, 'w', encoding='utf-8') as file:
file.writelines(transformed_lines)
print(f"Преобразованные данные записаны в {output_file}.")
if __name__ == "__main__":
main()