我正在尝试检查远程文件是否可写或不使用 paramiko。我目前的代码是
from paramiko.ssh_exception import SSHException, BadHostKeyException
import paramiko
import sys
from optparse import OptionParser
import os
stdin, stdout, stderr = self.__econnection.exec_command('bash');
stdin.write('if [ -w "%s" ];'%(temp_path))
stdin.write("then echo True;");
stdin.write("else echo False;");
stdin.write("fi;");
stdin.flush();
但是一旦我执行了这些行,shell就会卡住,我必须关闭shell。请帮忙..