Python paramiko script, problems reading output during exec_command()

前端 未结 4 1959
南方客
南方客 2021-01-02 04:03

Background: I am using python and paramiko to automate the process I go through everytime I have to hand in a program for a class. We use a command called

4条回答
  •  星月不相逢
    2021-01-02 05:05

    The problem might be that the remote command is waiting for input (it expects you to write something to stdin, not knowing that you aren't going to unless you tell so). Try stdin.channel.shutdown_write() (I believe stdin.close() by itself won't do the trick: that will only cause a flush)

提交回复
热议问题