Run python script at startup

April 24, 2023, 19:29

slivr

Hi all, I'm trying to get a python script to run when the pi starts up. I've tried crontab and rc.local, but neither works. I'm using a Pi 4.

slivr

It suddenly worked, not sure whether it was crontab or rc.local, but my program isn't working perfectly. I can't figure out how to get the desktop to boot up again.

slivr

Reinstalling isn't a big deal, but if I have to do it every time I test then its gonna take a long time

herogaca

I used crontab

herogaca

But crontab no sudo perms

herogaca

But then somehow did it like service idk??

slivr

I tried doing it as a service but it might not work for me, since I'm trying to launch a pygame program

slivr

The log gave the error on "screen_info = pygame.display.Info()" and said pygame.error: video system not initialized

herogaca

Then yse crontab