How can a script on local machine run a script and pass some value on remote machine (python)?

I've build a car using lego mindrstroms cv3 (runs on linux) and connected to it via bluetooth via shh. So far I can execute simple commands in python using shh on the remote device such as turning the motor or getting the sensors to give a signal when pressed. I'm trying to write a script that would allow me to control the car via arrow keys from my local keyboard, but I don't know how to get the pressed key from my local machine and send it to remote machine which then would execute appropriate command. Here are the question:

How can I write a script that would send my key value (keyboard is on my pc) to the car's computer (which I control via shh) and run another script there?

PS. What I want to know is how they can communicate between each other. Something like a function in programming languages you run a function and pass it a value but that function is on another device.