Why do you think that? Python is pretty OS independent. I don’t see anything that makes me think it wouldn’t work on a Pi.
I would request that you put your code in code fences.
When you do, paste the code into the forum between the code fences again. The forum will convert ""
to ‘’" (note they are slightly different) which do not work in code. As it is above, it will not work if users try to just copy and paste.
I think the Exec binding would work for this.
Thanks for posting!