0

我想/recordings/cameras从 Robot nao 下载文件到我的电脑。我怎样才能做到这一点 ?请给我一个例子(脚本)。

4

1 回答 1

1

您可以为此使用 Paramiko 包。

import paramiko


NAO_IP = "put_nao_ip_here"
NAO_USERNAME = "put_nao_username_here"
NAO_PASSWORD = "put_nao_password_here"

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(NAO_IP, username=NAO_USERNAME, password=NAO_PASSWORD)
sftp = ssh.open_sftp()
localpath = 'path to save the file locally with filename'
remotepath = '/recordings/cameras/<filename>'
sftp.get(remotepath, localpath)
sftp.close()
ssh.close()
于 2016-12-27T08:32:18.453 回答