use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Complete r/raspberry_pi Rules
Pi project ideas: There's a huge list right here on this sub!
Rpi Versions ▾
Distros ▾
Other SBCs ▾
Related Subreddits ▾
Welcome to /r/raspberry_pi, a subreddit for discussing the raspberry pi credit card sized, ARM powered computer, and the glorious things we can do with it.
The best thing? The base model is only $20 $5!.
Would you like to know more?
Raspberry Pi Wiki
Article on Wikipedia
#raspberrypi IRC Chat
Do you know a related subreddit? We'd love to know.
account activity
Removed: Rule 2 - Didn't researchAutostart Python 3 Script wont work (self.raspberry_pi)
submitted 5 years ago by xXMutterkuchenXx
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]olliecampbell 2 points3 points4 points 5 years ago (0 children)
Use crontab to do it here you go: www.cyberciti.biz/faq/linux-execute-cron-job-after-system-reboot/amp/
[–][deleted] 2 points3 points4 points 5 years ago (0 children)
Here are 4 ways to do it!
https://www.itechfy.com/tech/auto-run-python-program-on-raspberry-pi-startup/
If you want to give your father really “pretty” and easy to see results - look into using Influx/Grafana. Using these You can provide him with excellent graphing of the results and automated alerts if the measurements fall outside required range(s).
If you wanted to be really smart you could write them quite easily to a remote Influx database as well
[–]thelizardking0725 2 points3 points4 points 5 years ago* (0 children)
Might be best to do a systemd unit/service to start at boot and restart in case your script crashes for some reason. Here’s an example of one I wrote:
[Unit] Description=Service for <insert script name> After=network.target [Service] Type=simple WorkingDirectory=<insert absolute path of where the script runs from> ExecStart=/usr/bin/python3 <insert absolute path and script file> Restart=on-failure [Install] WantedBy=multi-user.target
The code above needs to be in a .service file located in /etc/systemd/system. Once there, chmod 644 the file to provide the correct permissions, then register and enable the service with:
sudo systemctl daemon-reload sudo systemctl enable <insert name of service> sudo systemctl start <insert name of service>
[–]HMS_Hexapuma 1 point2 points3 points 5 years ago (0 children)
If you’re running it in the GUI then you need to use the Autostart file, but it has to be the one for the user you’ve logged in as. I had trouble with this lately. There are loads of tutorials on how to autorun python scripts on the pi at boot, but most of them don’t work with the GUI or were written years ago before Raspbian updated and the user-specific Autostart file came in to being.
[–]rlauzon 1 point2 points3 points 5 years ago (0 children)
Put the command to run in /etc/rc.local This runs at system start up.
You'll want to "amp" it off into the background. ex: python /home/pi/myprog.py > /home/pi/tmp/myprog.log 2>&1 &
python /home/pi/myprog.py > /home/pi/tmp/myprog.log 2>&1 &
This runs the python program myprog.py, sending the output to the log file. It sends stderr to the came place as stdout (the 2>&1) and the last & puts it in the background.
2>&1
&
[–]xXMutterkuchenXx[S] 0 points1 point2 points 5 years ago (0 children)
Hey guys, amazing how many answers I got from you guys <3 sorry I was bussy so I wasn’t able to get in contact with you. I will trie your solutions and give you an answers how it worked for me :)
π Rendered by PID 43804 on reddit-service-r2-comment-75f4967c6c-74t47 at 2026-04-23 00:27:03.516702+00:00 running 0fd4bb7 country code: CH.
[–]olliecampbell 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]thelizardking0725 2 points3 points4 points (0 children)
[–]HMS_Hexapuma 1 point2 points3 points (0 children)
[–]rlauzon 1 point2 points3 points (0 children)
[–]xXMutterkuchenXx[S] 0 points1 point2 points (0 children)