Python for MiSTer system scripts

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
Bas
Top Contributor
Posts: 623
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Python for MiSTer system scripts

Unread post 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?

User avatar
aberu
Core Developer
Posts: 1192
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 247 times
Been thanked: 411 times
Contact:

Re: Python for MiSTer system scripts

Unread post 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.

birdybro~
User avatar
morf77
Posts: 63
Joined: Fri Aug 28, 2020 1:42 pm
Has thanked: 12 times
Been thanked: 24 times

Re: Python for MiSTer system scripts

Unread post 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.

Post Reply