You need to wait for application to finish, exec_command isn't a blocking call.
print now(), "before call"
stdin, stdout, sterr = ssh.exec_command("sleep(10)")
print now(), "after call"
channel = stdout.channel
print now(), "before status"
status = channel.recv_exit_status()
print now(), "after status"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…