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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:54:10+00:00 2026-06-09T19:54:10+00:00

I am learning Python at the moment, and I come from a Java/C++ and

  • 0

I am learning Python at the moment, and I come from a Java/C++ and C background. I usually like to “examine” the “objects” in debuggers to get a better understanding of what is going on, so excuse my question if it seems odd for python.

I was reading the urllib2 documentation at Python’s website. The following example was shown:

>>> import urllib2
>>> for line in urllib2.urlopen('http://tycho.usno.navy.mil/cgi-bin/timer.pl'):
...     if 'EST' in line or 'EDT' in line:  # look for Eastern Time
...         print line

I understand that urlopen will download the content of a page.

Does urlopen download the HTML content? I tried doing the following:

content = urllib2.urlopen('http://tycho.usno.navy.mil/cgi-bin/timer.pl')
print content

which yields an object. What is the nature of this object? Is it a dictionary-like object? If so, how can I examine what its key-values are? Would that be done using pickling in Python?

I am aware of the geturl() method, but I’d like to understand fully what urlopen() does and return.

Thank you!

  • 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-09T19:54:12+00:00Added an answer on June 9, 2026 at 7:54 pm

    Yes, and you can print the content using:

    print content.read()
    

    also, I’d like to suggest IPython, so you can inspect object methods and attributes very easily:

    dir(content)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I learning Python (coming from a dotnet background) and developing an app which interacts
learning python, coming from a php background. Keeping it short. Is there a way
I am learning python at the moment and I have a text file with
I'm learning Python and trying to test some rest web_service applications. From the below
I am learning Python at the moment and I have hit an issue. Observe
I'm learning python and Django coming from PHP. This is all really exciting, and
I am learning python, now, i came across a code snippet which looks like
I am currently learning Python from MIT OCW courses ? Anyone who have used
I'm learning Python. I'd like to do the following task: Input: a list: e.g.,
I'm learning python and i loop like this the json converted to dictionary: it

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.