Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- output_file_path = 'файл.txt'
- array_of_strings = ['строка1', 'строка2', 'строка3']
- # Записываем содержимое массива в файл
- with open(output_file_path, 'w') as output_file:
- for string in array_of_strings:
- output_file.write(string + '\n')
- print(f'Массив строк успешно записан в файл {output_file_path}.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement