telnet via jump host using python

from jumpssh import SSHSession

# establish ssh connection between your local machine and the jump server
gateway_session = SSHSession('gateway.example.com','my_user', password='my_password').open()

# from jump server, establish connection with a remote server
remote_session = gateway_session.get_remote_session('remote.example.com',password='my_password2')

Here is what the above code is Doing:
1. It creates a session to the gateway server.
2. It creates a session to the remote server from the gateway server.
3. It returns the remote session.

Now you can use the remote session to run commands on the remote server.