Program that starts when power is on, and stops when off
Posted: Mon Aug 08, 2016 8:27 am
Hi,
I'm a beginner in programming on raspberry pi. I would like to know is there is any easy way to make a python script that will run my main program when the raspberry pi is on. Also I would like to make this program stop with the moment when the power is off. I have to save my measure data to the file after each run of that program. I've been trying with rc.local and it seems like the program is running but when I reboot the device there is no file with the data gathered. Thanks for your help.
I'm a beginner in programming on raspberry pi. I would like to know is there is any easy way to make a python script that will run my main program when the raspberry pi is on. Also I would like to make this program stop with the moment when the power is off. I have to save my measure data to the file after each run of that program. I've been trying with rc.local and it seems like the program is running but when I reboot the device there is no file with the data gathered. Thanks for your help.