So, I am writing a program that, when I input a text, it writes it in a text file. The first problem I had was that it was overwriting itself every time I input something. What I want is so it would create a new line every time I input something.
textinput= "\TextInput: "
inputtext = input(textinput)
with open("Text Input.txt", "w") as f:
for text in inputtext:
f.write(text)
I fixed this problem by addingf.write("\n") in the for loop. The problem is, that in a for loop, it would keep repeating itself for every letter. Putting it outside of the for loop doesn't work, and keeps rewriting itself, like it used to. Is there any solution to this?