Program:

import os

f=open('abcd.txt','a')
msg=str(input("Enter Your Massage:"))
f.write("\n"+msg)
f.close()

#code for opening file
os.startfile("abcd.txt")  #Here we  are Not using file path beccuse our txt file 
                         # and program file in same Directory


Expected O/P:

Enter Your Massage:  Hey there I on the Terrace
  

 One text file window will promt name as "abcd.txt" and it  having  same location as program Directory.