timothyy wrote: ↑
Fri Sep 27, 2019 2:56 pm
Code: Select all
file = open(str(filename), 'a')
file.write(str(datetime.datetime.now()) + " " + str(texttowrite) + '\n')
I call the file on boot is /home/pi/Desktop/Testing/Text1.txt
That will work as you expect if
you run the script while you are the default pi
user and /home/pi/Desktop/Testing/
is your Current Working Directory.
(Apart from the issue of the difference in case between text1 and Text1.)
But for a script started during the system start-up process neither of these things is the case.
Have a think about which user runs the system startup, and where its default filestore is kept...