Page 1 of 1

Python for MiSTer system scripts

Posted: Tue Apr 25, 2023 3:53 pm
by Bas

Let's give this question its own topic:

To what extent is Python ok for use for scripts that aim to be included with the main project?


Re: Python for MiSTer system scripts

Posted: Tue Apr 25, 2023 4:31 pm
by aberu

Python is supported already, you call the script from within a bash script.

https://github.com/MiSTer-devel/Downloader_MiSTer

Requests to add more python modules to the image will likely not be accepted though as the image is kept purposefully very small.


Re: Python for MiSTer system scripts

Posted: Wed Apr 26, 2023 2:51 pm
by morf77

Calling the python script from a bash script is not necessary. With a shebang on the first line you can run python code from within a bash shell script (.sh file).

Just put this shebang on the first line of your .sh file:

Code: Select all

#!/usr/bin/python3

Everything after that can be python code like you would in a .py file. Of course make sure you make the .sh file executable with chmod +x.