Hello,
I assume that you are refering to your local python scripts/code on RUT, since remotely you can execute commands over HTTP using JSON-RPC.
If you have python on the RUT, you can import ‘os’ module and use it to execute SSH commands. If you want the command to return the value (as far as I remember OS returns status code), you can use subprocess module:
import os
import subprocess
os.system("echo $(cat /etc/version)")
# OR
vers = subprocess.check_output("echo $(cat /etc/version)", shell=True, text=True).strip()
print (f"Firmware version is {vers}.")
Kind Regards,