How to upload files with python script

741 views Asked by At

Is there a way to upload files from my PC to the Pepper robot using python script?

For example if there is some kind of function like

session.upload(file_path, robot_path)
1

There are 1 answers

0
JLS On BEST ANSWER

Can you use SFTP ?

In python:

import paramiko

ROBOT_URL = "10.80.129.69"

c_path = "wherever/that/is/on/the/computer"
r_path = "wherever/that/is/on/the/robot"

transport = paramiko.Transport((ROBOT_URL, 22))
transport.connect(username="nao", password="nao")
sftp = paramiko.SFTPClient.from_transport(transport)
sftp.put(c_path, r_path)

sftp.close()
transport.close()