问题描述
我想使用Paramiko获取X窗口信息,并运行此python代码,无法获取stdout。
代码和结果
# define ssh_manager
.
.
ssh_manager.exec_command("export DISPLAY=:0")
stdin,stdout,stderr= ssh_manager.exec_command("sudo xdotool getactivewindow getwindowname")
print(stdout.readlines())
-------------------------------------------------------------------------------------------
INFO:paramiko.transport:Connected (version 2.0,client OpenSSH_6.2p2)
INFO:paramiko.transport:Authentication (password) successful!
[]
但是它可以在localhost
上使用。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)