If I have this code to write a txt file I am just wondering why every time I type \n in the input it doesn't create a newline so like this.
This is the example txt file\n it doesn't create a new line\n how can I make it do it?
This is the code
def create():
path = input("What file would you like to create: ")
output_file = open(path, 'x')
text = input("What would you like to write? ")
output_file.write(text)
output_file.close()
def append():
path = input("What file would you like to append: ")
output_file = open(path, 'a')
text = input("What would you like to write?")
output_file.writelines(["\n", text])
output_file.close()
write = input("Would you like to write something today, or edit? ")
if write == "Write":
create()
if write == "Edit":
append()