# -*- coding: utf-8 -*-
import telnetlib
Host = '192.168.50.1'
username = 'admin'
password = 'admin'
finish = 'admin@RT-AC88U-EFE8:/tmp/home/root# '
tn = telnetlib.Telnet(Host)
#tn.read_until('RT-AC88U-EFE8 login: ')
tn.read_until(': ')
tn.write(username + '\n')
#tn.read_until('Password: ')
tn.read_until(': ')
tn.write(password + '\n')
#tn.read_until(finish)
tn.read_until('# ')
tn.write('mkdir abcde\n')
tn.read_until(finish)
tn.close()