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 7868461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:00:30+00:00 2026-06-03T01:00:30+00:00

I am attempting to automation turning off connected devices to an APC PDU using

  • 0

I am attempting to automation turning off connected devices to an APC PDU using python’s built in telnet functionality. I believe I am able to enter in the username and password, but I cannot proceed after that. My code is as follows:

    telnet_session = telnetlib.Telnet(host=self.apc_ip)
    self.logger.info("Entering APC Username")
    telnet_session.read_until("User Name :")
    telnet_session.write(self.apc_username + "\n")
    self.logger.info("Entering APC Password")
    telnet_session.read_until("Password  :")
    telnet_session.write(self.apc_password + "\n")
    sleep(2)
    print telnet_session.read_all()

I’m running windows so I believe that https://github.com/quackenbush/APC is not an option as I cannot install pexpect.

Any help would be appreciated.

Thanks,

Parth

  • 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-06-03T01:00:32+00:00Added an answer on June 3, 2026 at 1:00 am

    The issue was I wasn’t sending the correct end line.

    In windows it’s \r\n, not \n

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

Sidebar

Related Questions

I'm attempting to start some Outlook 2007 automation with Python. I got this great
I'm attempting to write find/replace code for Word documents using Word Automation through Interop.Word
I'm getting an Automation error upon running VBA code in Excel 2007. I'm attempting
I am attempting to use the Remove-Item cmdlet as part of an automation for
Attempting to set up Samba + OpenLDAP using nss_ldap. After joining Windows7 to Samba
Attempting to find printers / shares in Active Directory using C#. This is my
I am attempting to re-organize our test libraries for automation and nose seems really
I'm attempting to launch chrome using watir-webdriver but with a specific extension loaded. I
I am attempting to implement a WPF ViewModel using Castle Windsor Dynamic Proxies. The
I'm working with selenium to perform some automation and I'm attempting to interact with

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.