Код: Выделить всё
1
2
3
Код: Выделить всё
1
2
3hello
Код: Выделить всё
file_convt = open("test.txt", "w")
for i in range(0, 3):
file_convt.write(str(i) + "\n")
file_convt.write("hello")
file_convt.close()
Я только знаю,
Код: Выделить всё
with open(filepath, "w") as fp:
for line in lines:
print(line + "#", file=fp)
Подробнее здесь: https://stackoverflow.com/questions/711 ... -by-python