adamp27
Posts: 5
Joined: Sat Jun 10, 2017 3:55 pm

Run Python File after startup

Fri Jun 16, 2017 8:38 pm

Hi

So I have a python file that I want run as startup. I have a script that successfully launches the python program but I'm not sure where I need to place it in order to get the program up and running. I want the file to run immediately after the pi turns on and is logged in.

Thanks

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Run Python File after startup

Fri Jun 16, 2017 8:57 pm

Make it into a systemd service.

viewtopic.php?p=921354#p921354

It's easy, versatile, reliable and can even include a watchdog to keep your process alive.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Raspberry Pi OS”