Executing python scripts quite simple.
First you need to download and install python package with its dependencies. It can be achieved over SSH with the following commands:
- pokg update
- opkg install python3-light
Then simply upload/generate a script file and execute it with python command.
The question is rather, how/when do you want your script to be executed? Is it with each device boot, for which case you could place it in /etc/rc.local file, or with certain periodicity, which can be achieved using crontabs (more details here)?