You can create a script with following content and e.g. give it a name as 'telnet.sh'.
from telnetlib import Telnet
connection = Telnet('localhost', os.sys.argv)
Execution: (here 1235 is assumed to be your console-port)
An example of it being used:
$ ./telnet.sh 1235
Welcome to the DSA Management Console
*** Connection closed by remote host ***