Hi

I am new in python scripting. I want to open a Multiple telnet session
through once script. In other way i can tell i want to open two linux
consoles through one script.

I wrote one script, but the issue is I am not able to open multiple
consoles. The Scripts which i wrote is as follows:

import pexpect
session = pexpect.spawn("telnet localhost 2601\n")
session.expect("Password: ")
session.send("XYZ\n\n")
session.expect("Router1> ")
session1 = pexpect.spawn("telnet localhost 2604\n")
session1.expect("Password: ")
session1.send("ABCD\n\n")
session1.expect("ospfd> ")
#session1.interact()
session1.interact()

output :
ospf>

But in this case, i want in one console router one can open and on
other console ospf should open. But this i want to do is through one
script only.

Regds
Vik

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to