Automate ssh connection and execution of program with Python’s Paramiko

I want to automate a specific task using python.
This task includes, among some other things, connecting with ssh to a remote server, and running a specific program (call it prog.out) that may or may not ask for user input.
After some research and after weighting my options, I decided to use Python’s Paramiko (which may turned out to be wrong, considering the below…).

Is it possible to make the keyboard module work with pygame and threading

My friend challenged me to make a small program that allows the user to press a button on a Xbox controller and have it do multiple functions on the keyboard (like reWASD). I thought I almost made it to the end and found the having keyboard.press() and keyboard.release() wouldn’t do its function. Is there any possible way to make it do what I hoped it to do. Sorry for the bad English I am freshmen and its 1 am and I am new to stakoverflow formatting.