repl.it
@JerryTheMouse/

Function Save/Undo

Python

No description

fork
loading
Files
  • main.py
  • stuff.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
quit = None
f = open("stuff.txt", '')

while quit == None :

  prompt = input ("Do you want to [U]ndo, [R]edo, [E]dit text or [Q]uit this application: ")
  p =  prompt[0].lower()
  if p == 'q':
    quit = 'Quitting'
    print(f'Status: {quit}')
  elif  p == 'e' :
    addDoc = input(f"What do you want to add to the file? This file currently contains: \n{f.read()}\nInput: ")
    #addDoc = "test"
    f.write(addDoc)
    print (f"File currently contains: {f.read()}")
?