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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:28:05+00:00 2026-05-28T17:28:05+00:00

I am using a builtin SNMP library to get some data off a server.

  • 0

I am using a builtin SNMP library to get some data off a server. Now when I get it back it shows up in a list as


.>>> [ObjectName(1.2.6.1.4.1.111.1.4.1.7), Integer(21)]

When I print out x[0] (pretend x is that response^) I see 1.2.6.1.4.1.111.1.4.1.7 and 21 for x[1] but when I do type(x[0]) I get <type 'instance'>.

Now my question is that is there a way to find the type of x[1] and convert it to that? (x[0] will always be a string but x[1] can be integer, string or float etc.

Is there a way to read that “Integer” (in this case)?

Thanks

Edit:

I dont think I described it clearly. I really done care about x[0] at all, I want to convert the x[1] to what it is without modifying anything from the class that I am getting the SNMP data from. In this example its an int but it can be a float or a string. I am looking for a way to determine what the type of that instance is and then convert it to that

  • 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-28T17:28:06+00:00Added an answer on May 28, 2026 at 5:28 pm

    You get <type 'instance'> because the library is using old-style classes. You can get at the class name by using x.__class__. In your example x[0].__class__.__name__ would be ObjectName.

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

Sidebar

Related Questions

I'm using the built in web server in Visual Studio to test some pags
I am using xmlrpc-c library (http://xmlrpc-c.sourceforge.net) and I am writing both the server and
I am using the matches string builtin and need to run a regex pattern
How do I do the following using built-in modules only? I have a list
I'm using the built-in Domain Catalog database to list all the databases on a
I am using the builtin ASP.NET logon and user management features. Is there a
I have been using mysql in a new rails application, but now I wanted
SQL Server 2000 Standard, Windows 2003 My coworker removed 'BUILTIN\Administrators' group from SQL Server
I am using itoa builtin function, in order to convert an integer into binary
I'm trying to create REST services using Jersey (builtin) on Glassfish. I installed GlassFish

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.