I cannot seem to write time/date to the file.
I am using nowTimeDate2 elsewhere in my program and it can be printed to the screen.
The file exists and the program successfully opens the file, writes to it, and closes the file.
All is working as designed.
Now I want to place an entry into the first line of the file to note the time/date the file was created.
It doesn?t show up in the file.
How do I fix this?
from time import gmtime, strftime
nowTimeDate2=strftime("%Y %a %b %d %H:%M")
print(nowTimeDate2) #This works
DateReading.write = (nowTimeDate2 + "\n")
I also tried to append but that did not work either.
Interestingly enough, this is a feature that really has no real purpose in the final product yet it is hounding me.
<http://click1.email.theonion.com/fdhhznrjhrcwhhsdwbqczwybqhwgsbrpzdlbfybhqbhhj_bjcgpjgcpypgjzzbfqdd.html?a=TheOnion_Daily_RSS&b=&c=> Ultrasound Technician Asks Pregnant Woman If She?d Like To Know Baby?s Name