Код: Выделить всё
with open('example_file', 'r') as file:
file_content = file.readlines()
file.close()
with open('example_file', 'w') as new_file:
for line in file_content:
if line.strip("\n") != 'example_line_1':
new_file.write(line)
new_file.close()
Подробнее здесь: https://stackoverflow.com/questions/631 ... ith-python
Мобильная версия