如何优化网站首页代码,片多多影视剧免费观看在线观看,自定义内容网站,防伪查询网站我正在使用paramiko在远程windows服务器上执行命令。我能够执行dir之类的命令并提取输出#xff0c;但是执行python脚本似乎失败了。不会引发错误消息。在下面是我的代码片段#xff1a;def ssh_connect(ip,user,pwd):ssh paramiko.SSHClient()ssh.set_missing_host_key_pol…我正在使用paramiko在远程windows服务器上执行命令。我能够执行dir之类的命令并提取输出但是执行python脚本似乎失败了。不会引发错误消息。在下面是我的代码片段def ssh_connect(ip,user,pwd):ssh paramiko.SSHClient()ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())ssh.connect(ip, usernameuser, passwordpwd)return sshdef execute_command(device_details, command):ip device_details.get(ip)username device_details.get(username)password device_details.get(password)ssh_ns_obj ssh_connect(ip, username, password)ssh_stdin, ssh_stdout, ssh_stderr ssh_ns_obj.exec_command(command)print ssh_stderr.read()return ssh_stdout.read()device_details dict()device_details[ip] a.b.c.ddevice_details[username] Administratordevice_details[password] passcommand_1 cmd /c mkdir asdfoutput execute_command(device_details, command_1)command_2 cmd /c C:\Users\Administrator\AppData\Local\Programs\Python\Python36\python.exe C:\pythonattempt\try.pyoutput execute_command(device_details, command_2)以下是我在command_2中提到的try.py^{pr2}$command_1执行成功我可以看到在我的windows机器上创建的目录。但是command_2不会抛出任何错误但也不会被执行。在我知道是因为x.txt或文件夹x没有创建。在我已经在Windows上安装了freeSSHd服务。我能够ssh进入我的Windows机器执行完全相同的命令它正在工作。在见下图我该怎么做在