Article 55CES Program aborts after using CAT

Program aborts after using CAT

by
Ockwig
from LinuxQuestions.org on (#55CES)
Hardware : Raspberry Pi 4
Software : Raspberry pi OS

Program Python3:

from gpiozero import CPUTemperature
from time import sleep, strftime, time

cpu = CPUTemperature()

with open("/home/pi/cpu_temp.csv", "a") as log:
while True:
temp = cpu.temperature
log.write("{0},{1}\n".format(strftime("%Y-%m-%d %H:%M:%S"),str(temp)))
sleep(900)

Issues:

I can run the above program and everything appears to work, however two issues
1. Time does not match, see example at end
2. When I use Cat command, program seems to abort(Is this normal?)

Example output:

Started program at 10:43

2020-07-04 09:44:08,26.284
2020-07-04 09:59:08,27.258
2020-07-04 10:14:08,28.232
2020-07-04 10:29:08,26.284
2020-07-04 10:44:08,27.258

Cat at 11:50, after that no more updates, like the program froze

Thanks,
Jerrylatest?d=yIl2AUoC8zA latest?i=jb-U0OqzxRI:mJS8ljfvEtk:F7zBnMy latest?i=jb-U0OqzxRI:mJS8ljfvEtk:V_sGLiP latest?d=qj6IDK7rITs latest?i=jb-U0OqzxRI:mJS8ljfvEtk:gIN9vFwjb-U0OqzxRI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments