anapivirtua Boh. | Messieurs bonjour je cherche à exécuter en même temps 4 sessions telnetlib mais à priori ce n'est pas possible:
class telnetlib.Telnet([host[, port[, timeout]]])¶
Telnet represents a connection to a Telnet server. The instance is initially not connected by default; the open() method must be used to establish a connection. Alternatively, the host name and optional port number can be passed to the constructor, to, in which case the connection to the server will be established before the constructor returns. The optional timeout parameter specifies a timeout in seconds for blocking operations like the connection attempt (if not specified, the global default timeout setting will be used).
Do not reopen an already connected instance. |
Quelqu'un aurait la solution ou une petite idée à me soumettre ?
Voici le morceau qu'il faudrait que je fasse tourner 4x en même temps:
tn = telnetlib.Telnet(sys.argv[1])
tn.read_until("Username: " )
tn.write(usr + "\n" )
if pswd:
tn.read_until("Password: " )
tn.write(pswd + "\n" )
tn.write(["ping vrf ", sys.argv[2], " ", sys.argv[5], " ", "size 15000 repeat 5000 \n"]) |
Merci d'avance Message édité par anapivirtua le 27-01-2011 à 18:25:12 ---------------
Si vis pacem, para bellum.
|