0

So I would like to be able to have this piece of code add to the Suggestions.txt instead of replacing what there is already in there (ie two lines below the existing content)

input1 = input("What is your name?:  ")

input2 = input("What is your suggestion for another issue to be solved:  ")

input3 = input("Do you know how to solve this issue? If not press enter:  ")

input4 = input("What keywords would the user need to use to access the solution? \n Press enter to leave blank:  ")

file = open("Suggestions.txt", "w")

file.write("Name: " +input1 + "\n")

file.write("Suggestion: " +input2 + "\n")

file.write("Solution: " +input3 + "\n")

file.write("Keywords: " +input4 + "\n")

file.close()

It is so that multiple people can write what their suggestions are without being overrided by the next people.

I would like it so that it automatically just adds below, and this does not seem to be the case in the other thread.

Leo Codron
  • 17
  • 2

1 Answers1

0

You need to change w to a, ie: file = open("Suggestions.txt", "a")

TitanFighter
  • 4,582
  • 3
  • 45
  • 73