My first naive way would be writing the output (python script) into a file and send it via scp
but given that there output is generated overtime (like inconstantly between 1s and 1 day periods) I don't think that opening a file, writing it and then sending it is the smartest way.
Is there a better way? It doesn't have to be ssh
but something that does not require port-forwarding or UDP holepunching.
myprogram | ssh -o ServerAliveInterval=300 me@remotecomputer "cat > file"
do what you want? – Mark Plotnick Jan 05 '21 at 15:22