Running python script from HASS docker on host raspbian

i am using home assistant docker on raspbian buster and i need to run a python script triggered from home assistant on the raspbian host.

  play_selected_playlist: 'python3 /home/pi/homeassistant/python3/ {{ states("input_select.selectionlist") }}'

this shell script is to be launched every time input_select.selectionlist changes so i’m using automation for it, but clearly - the .py script won’t be accessible form the docker.

i’m not sure what’s the best way to make it happen - will appreciate any ideas