title: Python telnet connection failure
body: <p>I have device that accepts telnet connection to use it with AT commands</p>
  
  <p>This is my code, should be simple I believe but it won't work for some reason I'm fairly new to telnet lib so I don't understand what I am missing here</p>
  
  <pre><code>def connect(self, host, port):
      try:
          Telnet.open(host, port)
          Telnet.write('AT'+"\r")
          if Telnet.read_until("OK"):
              print("You are connected")
      except:
          print("Connection cannot be established")
  </code></pre>
  
  <p>it always hits the except.</p>
  
  <p>I am also getting the following error when I just try and import telnetlib and run it just with an IP with no port.</p>
  
  <pre><code>Traceback (most recent call last):
  File "&lt;pyshell#9&gt;", line 1, in &lt;module&gt;
  Telnet.open('192.168.0.1')
  TypeError: unbound method open() must be called with Telnet instance as 
  first argument (got str instance instead)
  </code></pre>
  
  <p>I am having problems understanding what does it want me to do.</p>