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

  • Home
  • SEARCH
  • 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 8140409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:09:23+00:00 2026-06-06T12:09:23+00:00

code: import urllib,urllib2 url = ‘http://www.pythonchallenge.com/pc/def/linkedlist.php’ print urllib2.urlopen(url).read() print urllib2.urlopen(url,urllib.urlencode({‘nothing’:12345})).read() the question I encounter

  • 0

code:

import urllib,urllib2
url = 'http://www.pythonchallenge.com/pc/def/linkedlist.php'
print urllib2.urlopen(url).read()
print urllib2.urlopen(url,urllib.urlencode({'nothing':12345})).read()

the question I encounter is why the two ‘print’ output the same content,
where is problem in my code?

  • 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-06T12:09:26+00:00Added an answer on June 6, 2026 at 12:09 pm

    The second argument to urlopen is data to be POSTed. If you want URL arguments you need to create the URL:

    print urllib2.urlopen("%s?%s" % (url,urllib.urlencode({'nothing':12345}))).read()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

import urllib import urllib2 from urllib2 import Request url = 'https://www.google.com' response = urllib2.urlopen(url)
The code below binds an ip address to urllib, urllib2, etc. import socket true_socket
This is my code: from xgoogle.search import GoogleSearch, SearchError import urllib, urllib2, sys, argparse
If I use Urllib2 to open a url using this: import urllib import urllib2
I have the following fully functional, working code: import urllib.request import zipfile url =
I have problems with my code. #!/usr/bin/env python3.1 import urllib.request; # Disguise as a
I am running the following code on ubuntu 11.10, python 2.7.2+. import urllib import
Let's say I have the following code in Google App Engine: from urllib import
Code: import com.independentsoft.exchange.Service; import android.app.Activity; import android.os.Bundle; public class ContactsToExchangeActivity extends Activity { @Override
I have this code: import re def doReplace(toReplace): i = 1 def chapterReplacer(_): result

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.