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

后端 未结 5 1619
甜味超标
甜味超标 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:58

    A solution in which you don't explicitly send your data over some connection would be to use sshfs. You can use it to mount a directory from Machine2 somewhere on Machine1 and writing to a file in that directory will automatically result in the data being written to Machine2.

提交回复
热议问题