Hello, I am new to python programming, and was attempting to get my feet wet by trying the popular telnet program on the web; here is the program. The problem is; I am trying to telnet to a switch, and execute some programs, but I am getting no where:
Please help me get started; once I get this first step going, I believe I could build on it.
Thanks.
**import getpass
import sys
import telnetlib
HOST = '192.168.10.2'
user = raw_input('Enter your remote account: ')
password =import getpass
import sys
import telnetlib
HOST = '192.168.10.2'`Inline Code Example Here`
user = raw_input('Enter your remote account: ')
password = getpass.getpass()
tn = telnetlib.Telnet(HOST)
tn.read_until('login: ')
tn.write(user + '\n')
if password:
tn.read_until('Password: ')
tn.write(password + '\n')
tn.write('vt100\n')
tn.write('ls\n')
tn.write('exit\r\n')
print tn.read_all**