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 :
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
so how to use a modified init.py in certain scripts,while all other scripts that use “import buttonshim” import the original version ?