• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(2590)  |  Call(2240)  |  Derive(0)  |  Import(350)
Create a file-like object for the specified URL to read from.

        def urlopen(url, data=None, proxies=None):
    """Create a file-like object for the specified URL to read from."""
    from warnings import warnpy3k
    warnpy3k("urllib.urlopen() has been removed in Python 3.0 in "
             "favor of urllib2.urlopen()", stacklevel=2)

    global _urlopener
    if proxies is not None:
        opener = FancyURLopener(proxies=proxies)
    elif not _urlopener:
        opener = FancyURLopener()
        _urlopener = opener
    else:
        opener = _urlopener
    if data is None:
        return opener.open(url)
    else:
        return opener.open(url, data)
        


src/p/a/pacmaintainer-HEAD/trunk/tools/example_pacparserfile.py   pacmaintainer(Download)
        break
  try:
    sys.stderr.write('trying to fetch the page using proxy %s\n' % proxy)
    response = urllib.urlopen(url, proxies=proxies)
  except Exception, e:
    sys.stderr.write('could not fetch webpage %s using proxy %s\n' %
                     (url, proxies))

src/p/a/pacmaintainer-HEAD/tools/example_pacparserfile.py   pacmaintainer(Download)
        break
  try:
    sys.stderr.write('trying to fetch the page using proxy %s\n' % proxy)
    response = urllib.urlopen(url, proxies=proxies)
  except Exception, e:
    sys.stderr.write('could not fetch webpage %s using proxy %s\n' %
                     (url, proxies))

src/s/i/simple-odspy-HEAD/examples/sods_server.py   simple-odspy(Download)
	try:
		# check if a server already running
		try:
			f = urllib.urlopen("http://127.0.0.1:%s/" % port, proxies={})
 
			print """
			A web server already using port %s

src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/site-packages/isapi/samples/redirector_with_filter.py   ironruby(Download)
        if url.startswith(virtualdir):
            new_url = proxy + url[len(virtualdir):]
            print "Opening", new_url
            fp = urllib.urlopen(new_url)
            headers = fp.info()
            ecb.SendResponseHeaders("200 OK", str(headers) + "\r\n", False)
            ecb.WriteClient(fp.read())

src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/site-packages/isapi/samples/redirector_asynch.py   ironruby(Download)
    def Dispatch(self, ecb):
        print 'IIS dispatching "%s"' % (ecb.GetServerVariable("URL"),)
        url = ecb.GetServerVariable("URL")
 
        new_url = proxy + url
        print "Opening %s" % new_url
        fp = urllib.urlopen(new_url)

src/p/y/PyAMF-HEAD/doc/tutorials/examples/actionscript/ohloh/python/ohloh.py   PyAMF(Download)
    # Connect to the Ohloh website and retrieve the account data.
    params = urllib.urlencode({'api_key': api_key, 'v': 1})
    url = "http://www.ohloh.net/accounts/%s.xml?%s" % (emailhash.hexdigest(), params)
    f = urllib.urlopen(url)
 
    # Parse the response into a structured XML object
    tree = ET.parse(f)

src/f/e/fepy-HEAD/example/gnosis_test.py   fepy(Download)
from urllib import urlencode, urlopen
from gnosis.xml.objectify import make_instance
 
key = 'bb3b53838b4f980367c230baf132958de15a98a9'
isbn = '059035342X'
query = dict(apikey=key, target='meta', q='', isbn=isbn)
url = 'http://apis.daum.net/search/book?' + urlencode(query)
channel = make_instance(urlopen(url))

src/d/o/documancer-HEAD/vendor/yws/current/python/example1/YahooSearchExample.py   documancer(Download)
    print '<p>API Query: <a href="%s">%s</a></p>' % (yurl, yurl)
 
    # Connect to Y! Search service
    xmlfile = urllib.urlopen(yurl)
 
    parser = xml.sax.make_parser()
    handler = XmlDigester(handle_result)

src/d/o/documancer-HEAD/vendor/yws/1.0/python/example1/YahooSearchExample.py   documancer(Download)
    print '<p>API Query: <a href="%s">%s</a></p>' % (yurl, yurl)
 
    # Connect to Y! Search service
    xmlfile = urllib.urlopen(yurl)
 
    parser = xml.sax.make_parser()
    handler = XmlDigester(handle_result)

src/p/y/python-sdk-HEAD/examples/oauth/facebookoauth.py   python-sdk(Download)
            # Download the user profile and cache a local instance of the
            # basic profile info
            profile = json.load(urllib.urlopen(
                "https://graph.facebook.com/me?" +
                urllib.urlencode(dict(access_token=access_token))))
            user = User(key_name=str(profile["id"]), id=str(profile["id"]),
                        name=profile["name"], access_token=access_token,

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next