Skip to contentSkip to conversation

execute a python code in raspberrypi #python

DISCUSSION [email protected] 2 participants 2 messages Aug 13, 2021 – Aug 17, 2021

lore
Share & tools
lore
#0 lore raw

Hello beautiful people,

I successfully executed helloworld.py on the raspberrypi by making a layer. BUt now i need to add a whole python code with classes etc, which exists in different files like the picture, I wanna know please how to add them to be able to run the code on the raspberrypi. THey re all related together and i need to run the main-SF.py so the code will be executed.

THank you .

#1 lore raw
Quoted 9 lines · On Fri, 2021-08-13 at 02:40 -0700, [email protected] wrote:

Hello beautiful people,

I successfully executed helloworld.py on the raspberrypi by making a layer. BUt now i need to add a whole python code with classes etc, which exists in different files like the picture, I wanna know please how to add them to be able to run the code on the raspberrypi. THey re all related together and i need to run the main-SF.py so the code will be executed.

I recommend putting your whole python project into a repository (e.g. with git) and then create a recipe that fetches the git repository and installs the files to a sensible location.

You should be able to follow the documentation on writing a new recipe to some degree:

https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#new-recipe-writing-a-new-recipe

To run your script on boot, I would create an init script / systemd service, depending on what init system your image is using. See here for more information:

https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#new-recipe-enabling-system-services

Quoted 1 line

THank you .