Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6679343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:20:54+00:00 2026-05-26T04:20:54+00:00

When I run this Python 3.1 code to access a device using telnetlib, it

  • 0

When I run this Python 3.1 code to access a device using telnetlib, it works as expected:

import telnetlib

tn = telnetlib.Telnet("15.39.100.126", "23")
tn.write(b"menu\n")
tn.write(b"0\n")
print(tn.read_all().decode('ascii'))

Then, I run this code (very similar to above, but this port presents different menus) to port 223 and get nothing:

import telnetlib

tn = telnetlib.Telnet("15.39.100.126", "223")
tn.write(b"ipconfig\n")
tn.write(b"exit\n")
print(tn.read_all().decode('ascii'))

When running the telnet session to 223 manually, it reports this:

WinCEPocket CMD v 6.00
\> 

Has anyone ever run into something like this with different telnet behavior with Python on the same device but different ports, or does anyone know what special approach I need to take with WinCE Pocket? Port 23 does NOT use WinCE Pocket – only port 223 does. Both telnet programs run equally well from the same windows command shell.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:20:55+00:00Added an answer on May 26, 2026 at 4:20 am

    The telnet command itself does different things for port 23 vs other ports: Primarily it implements telnet option negotiation. The purpose of telnetlib is to implement the Telnet protocol (option negotiation etc) for you so that you can interact with a service on port 23 that expects telnet on the other end. Since telnet the command does not do these things for port 223 it’s likely that your device is not expecting telnet option negotiation and is being confused by the initialization of telnetlib (sending telnet options in-band).

    The solution would be to use plain socket to interact with port 223. There are lots of examples of that on SO already.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

/Users/smcho/Desktop/bracket/[10,20] directory has abc.txt, but when I run this Python code import glob import
I'm using uwsgi on Nginx to run some Python code. I'd like to bind
I was writing a twitter program using tweepy. When I run this code, it
I usually perform things like this in C++, but I'm using python to write
When I run this code the selected item is not visible. I've already tried
when i run this code : CONADefinitions.CONAPI_FOLDER_INFO2 FolderInfo; int iResult = 0; IntPtr Buffer
when I run this JS in FF or Safari it works just right but
So I run this Windows Server 2008 security update and this code block is
When I run this code, About half-way through the concatenation loop, $xml becomes null
I have a very frustrating python problem. In this code fixedKeyStringInAVar = SomeKey def

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.