问题
I want to capture the screenshot of a remote computer using paramiko. I am using the following code for that
import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('10.93.80.63', username='root', password='bohica')
ssh.exec_command("xwd -display :0 -silent -root > myscreen.xwd")
ssh.close()
The issue is that the file myscreen.xwd is created but the size is 0. Could you please let me know how I can capture the screenshot.
回答1:
Resolved this issue. The issue was that xwd was not executable and was not in the standard path. Resolved this issue by moving xwd to the standard path.
来源:https://stackoverflow.com/questions/13509955/paramiko-exec-command-redirect-to-a-file