I am trying to create a Python program where the user can input text into a file. After they close and save the file, I want to print its content. How do I detect when the user has saved and closed the file?
This is the code I have used to open the text file.
def opentextbox():
login = os.getlogin()
file1 = open('C:/Users/'+login+'/enteryourmessagehere.txt', 'a')
file1.close()
subprocess.call(['notepad.exe', 'C:/Users/'+login+'/enteryourmessagehere.txt'])
opentextbox()