telnet.py 216 B

123456789
  1. # Send a command over telnet to remote host:
  2. # telnet.py <host> <port> <string>
  3. import sys
  4. import telnetlib
  5. with telnetlib.Telnet(sys.argv[1], sys.argv[2]) as t:
  6. t.write((sys.argv[3] + '\n').encode('utf-8'))