#!/usr/bin/python
import sys, telnetlib, getpass
newipaddr = '192.168.96.137'
swlogin = 'root'
swpass = getpass.getpass()
tn = telnetlib.Telnet(newipaddr)
tn.read_until("username:")
tn.write(swlogin)
tn.read_until("password:")
tn.write(swpass)
tn.write("logout\n")
print tn.read_all()
DES-3526 Fast Ethernet Switch Command Line Interface
Firmware: Build 5.01.B52
Copyright(C) 2008 D-Link Corporation. All rights reserved.
username:root
password: