-1

how to autorun a python program in raspberry pi when power supply is ON. we followed the link https://www.youtube.com/watch?v=8iU9TnYFOV0 but it is not working

jisna
  • 7
  • 3
  • 3
    Welcome to stackexchange rpi. While we would love to help, there is really nothing to answer here. Please describe exactly what you want to achieve, exactly what you tried and exactly howw the actual outcomee differed from the expected one. We don't like to follow links - please include it all in text in your question. – Bex Jan 08 '15 at 10:47
  • Check http://raspberrypi.stackexchange.com/questions/23451/rpi-b-java-application-at-boot-time/23452#23452 That should help. If something comes up, feel free to edit your question to ask that! – Ghanima Jan 08 '15 at 13:39
  • When Power is ON = when the system is booting (assuming anything won't fail before). There are tons of tutorials on the web about making linux run a shell command on startup. As you know, executing a python script is nothing else than firing a command. Just google linux run script on startup . For more detailed tutorial replace "Linux" with "Debian". – thekiwi5000 Jan 08 '15 at 15:45

1 Answers1

2

You could use crontab for that

crontab -e

or

cron -e

depending of the OS you are using, and insert

@reboot python /path/to/file.py

that should do it, but remember to put the path to the full path to the file, this is essential.

Ghanima
  • 15,837
  • 15
  • 61
  • 119
Gonçalo
  • 401
  • 2
  • 8