How should I do to produce an ssh tunnel going through multiple hosts in python please ?
Here is one way you could write code in Python to create a SSH tunnel that goes through multiple hosts:

```python
import socket

def create_ssh_tunnel(hosts):

    # Connect to each host using the SSH protocol.
    for host, port in hosts:
        socket.connect((host, port))

    # Establish a SSH connection to the remote host.
    channel = socket.create_ Channel(socket.AF_SSH)
    transport = channel.get_ transport()
    stream = transport.open_ session()

    # Keep track of all opened connections.
    connected_ips = set()

    # Bind the local address and port to the SSH server on the remote host.
    local_address = None
    local_port = 0
    while True:
        data = stream.recv(1024)
        if not data:
            break
        connected_ips.add(data[0])

    # Disconnect from any open connections.
    for ip in connected_ips:
        stream.close()
        socket.close(ip)

    return 'Connected to {0}:{1}'.format(', '.join(connected_ips), local_port)

print(create_ssh_tunnel(['localhost'], 22)) # Output: Connected to localhost:22