hostname = form.getvalue('name') or None
if hostname and form.getvalue('memory'):
    ssh = paramiko.SSHClient()
client.load_host_keys(os.path.expanduser('~/.ssh/known_hosts'))
client.connect(hostname, username='testuser')
stdin, stdout, stderr = client.exec_command('free -m')
for line in (stdin, stdout, stderr):
    print(line.strip('\n'))
client.close()
Python CGI с парамико