python - How to pass variable from remote SSH'd machine to the host machine? -


ps> problem python specific

background: so, have 2 machines- machine a- work machine machine b- remote machine

i have python script running on machine a, ssh's remote machine , invokes script in remote machine using-

subprocess.call("ssh user@url 'python abc_script.py'") 

i can pass variables remote machine follows-

subprocess.call("ssh user@url 'python abc_script.py var1 var2'") 

but want return few variables remote machine host/the machine ssh'd remote

how can this?

one way figured use popen() or getstatusoutput()instead of call() return stdout (all print "" statement outputs) values

what way return 2 variables remote machine machine ssh'd in remote machine?