Help!How to parse value from rule file to python and how to get value from python to rule file?

hello friends I have a variable inside rule file and I really want to parse its value to a python script. In that script I’ve already had the code to convert the variable’s value to a desiring result I need (I tested on terminal and it was perfect - i’m using OH2 on raspberry pi 3). What should I do to parse the value I mentioned?
After converting I need to get the result from python script and parse it to the variable in rule file. I don’t know how to do it either, please show me how???
Any answer will be a great help! thanks all! I’d be very happy if you could show me!


I need this too

Try storing the variable from rule in an item (type String or Number, depending on your variable) and use the exec binding to send it to the python script!