In Python, how to write a string to a file on a remote machine?

后端 未结 5 1624
甜味超标
甜味超标 2020-12-16 00:11

On Machine1, I have a Python2.7 script that computes a big (up to 10MB) binary string in RAM that I\'d like to write to a disk file on Machine2, which is a remote machine.

5条回答
  •  天命终不由人
    2020-12-16 00:47

    If just calling a subprocess is all you want, maybe sh.py could be the right thing.

    from sh import ssh
    remote_host = ssh.bake() 
    remote_host.dd(_in = , of=) 
    

提交回复
热议问题