@
black_eagle
This is what I did in addon script.py
import requests
r = requests.get("http://192.168.1.200:4080/storage/.kodi/addons/test2.py")
code = r.text
with open("/Users/user/AppData/Roaming/Kodi/addons/script.activatewindowid/tmp.py", "w") as f:
f.write(code)
test2 = __import__('tmp')
if test2.x == 101:
xbmc.executebuiltin('ActivateWindow(1199)')
else:
xbmc.executebuiltin('ActivateWindow(settings)')
what I want that remote kodi hardware need to click on button and activate two python scripts one is test.py which contain json-rpc to execute script.py in kodi pc as mention above, the second is test2.py which contain an x value to use it in Kodi pc with if function as mention above as well.
For that reason I used http server to let kodi in pc to read test2.py in remote kodi 192.168.1.200.
but in other way I will try your way as you suggested will be much safer as well.