/recordings/cameras
Robot nao から自分のコンピュータにファイルをダウンロードしたい。どうやってやるの ?例 (スクリプト) を教えてください。
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 に答える