how to run this python script in Raspberry pi 3 on startup?

import webbrowser


or any solution play this video in Raspberry pi 3 at bootup

i need urgent solution regarding this task i will be very thankful


You could use a crontab to run a python file you have saved. This simple crontab editor tool is quite useful for crontabs.

To see your current tasks scheduled by cron and to create new ones use the command crontab -e. Then if you wanted it to run on boot then you could put something like @reboot sudo python /home/pi/path/to/file.py at the bottom, save it and reboot.

If you run into any issues whilst trying this you can use grep cron /var/log/syslog to check the logs for cron on boot.

Hope this helps.

| improve this answer | |
  • 3
    You can't start GUI programs from crontab. So this answer won't work. – Dougie Mar 9 '19 at 0:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.