我尝试关注instructions of the scpclient。
我写了以下代码:
data = [[12, 0.029], [12, 0.039], [12, 0.012], [13, 0.04], [13, 0.01]]
d = collections.defaultdict(list)
for key, val in data:
d[key].append(val)
# if you need same order as in `data` use OrderedDict with setdefault method
data_to_plot = d.values()
# Output: [[0.029, 0.039, 0.012], [0.04, 0.01]]
但是我收到了以下错误:
import paramiko
client = paramiko.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.WarningPolicy())
client.connect("my_ip", username="root", password="password")
stdin, stdout, stderr = client.exec_command('display version')
with closing(Write(client.get_transport(), '.')) as scp:
scp.send_file("/tmp/myfile", remote_path="/tmp")
client.close()
可能是什么原因?