5 button shim : how to keep led on after script exit?

#!/usr/bin/env python
import buttonshim
buttonshim.set_pixel(200, 0, 0)

I would like to set the led color (&exit the script) and let it stay that way until I change it again.
The 3liner above does the trick,yet as soon as the script exits,the led is off again :(

Is that the whole script?
How do you exit it?

I want to use the button shim led for multiple purposes,not only for button actions.
so I created led_green.py led_red.py and so on

led_red.py consists of :

#!/usr/bin/env python
import buttonshim
buttonshim.set_pixel(200, 0, 0)

I call the script,it sets the led red and exits

But I already discovered why this happens :
the buttonshim module gets loaded from :

the init.py there @ line 174/416 within the _quit function :

==> set_pixel(0, 0, 0)

which means as soon as a python script (that loaded the buttonshim module) exits,the led will be turned off.

When I # this line,the led stays on,but thats not good if you want to use the led for button related actions as it was original intented.

so I created a modified init.py without the quit action,sadly I fail to import this within my led scripts.

I tried to add an alternative sys path to the modified init.py,but its not working :
I placed the init.py & init.pyc in /home/pi/shortcuts/python/buttonshim

sys.path.insert(0, r’/home/pi/shortcuts/python/buttonshim’)
import buttonshim


so how to use a modified init.py in certain scripts,while all other scripts that use “import buttonshim” import the original version ?

found a solution for the solution :)

cp /usr/local/lib/python2.7/dist-packages/buttonshim

edit the init.py there

and in a script where the led should stay on after quiting said script => just use “import buttonshim2”

this should to the trick,will test it in the evening when Im back home again and will report back (luckily coding can be done from anywhere :) )

Thats all stuff thats pretty well above my skill level.
I’ve had just the opposite situation. I have a Sense Hat and LED shim displaying stuff and if I exit my python file they just stay lit with what ever was up when my script exited. I had to add clear commands for each one to turn all the LED’s off just before I exit my script and shutdown my Pi.
I have one Pi that is left powered up after doing the shutdown via a button press and code in my python script. I want it to go dark when that happens so I don’t have to unplug it.

yeah those workarounds are often necessary,good thing is by doing these,you learn a lot.
A year ago I didnt have any clue@python,now I just LOVE IT :)

#!/usr/bin/env python
import buttonshim2
buttonshim2.set_pixel(200, 0, 0)

WORKS !!! now I can set the led with any color I like and it STAYS that way until I change it.