I’m trying to a run a python script directly over ssh like this:
ssh hostname python_script
Unfortunately nothing happens after python starts, and in fact the python process that is created remotely stays “alive” even after I disconnect from SSH. The same thing happens if I try to start the python interpreter, but other commands work fine.
Try
ssh -t hostname python_script. By default,sshdoesn’t allocate a pseudo-tty to interact with when it’s given a program to run (although it does if you just dossh hostname);-ttells it to do so.