I'm trying to make my program ask for input (for example a name) and save this name with pickle to a new line each time it is run to a text file. For example: If I wanted to save the name "John" the first time it would save on the first line "John", then the second time I ran the program, it would save the name "Jeff" on the second line and so on.
I've already imported and set up the asking for input and the part where pickle dumps it to a file.
import pickle
print("Hello!")
name = input("What is your name? : ")
print (name)
file1 = open("store.txt", "wb")
pickle.dump(name, file1)
file1.close()
It does save the input but every time I rerun the program and input a different string, it overwrites the previous one.