• 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/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/c/o/consensus-0.1.1/examples/scrobbler.py   consensus(Download)
from cElementTree import ElementTree, fromstring
from urllib import urlopen
import shelve
import time
import sys
 
def getTopArtists(user):
    url = "http://ws.audioscrobbler.com/1.0/user/%s/topartists.xml"
    try:
        node = ElementTree(file=urlopen(url % user))
def getNeighbours(user):
    url = "http://ws.audioscrobbler.com/1.0/user/%s/neighbours.xml"
    try:
        node = ElementTree(file=urlopen(url % user))
    except (AttributeError, SyntaxError):
        return []
    time.sleep(1.5)
    return [u.get('username') for u in node.findall('user')]
 
def getFriends(user):
    url = "http://ws.audioscrobbler.com/1.0/user/%s/friends.xml"
    try:
        node = ElementTree(file=urlopen(url % user))

src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/site-packages/isapi/samples/redirector.py   ironruby(Download)
import sys
import traceback
try:
    from urllib import urlopen
except ImportError:
    # py3k spelling...
    from urllib.request import urlopen

src/b/i/BigBlueButton-PythonExample-HEAD/api.py   BigBlueButton-PythonExample(Download)
#! coding: utf-8
# pylint: disable-msg=W0311
from uuid import uuid4
from time import time
from random import randint
from hashlib import md5, sha1
from urllib import urlopen, quote_plus

src/p/y/python-cookbook-HEAD/cb2_examples/cb2_13_2_sol_1.py   python-cookbook(Download)
from urllib import urlopen
doc = urlopen("http://www.python.org").read()
print doc
 

src/c/o/codetalker-HEAD/tests/data/getcexamples.py   codetalker(Download)
#!/usr/bin/env python
from urllib import urlopen as upen
import re
 
def get_code(num):
    print 'get page...'
    url = 'http://www.c.happycodings.com/code_snippets/code%d.html' % num

src/c/o/CodeTalker-1.0/tests/data/getcexamples.py   CodeTalker(Download)
#!/usr/bin/env python
from urllib import urlopen as upen
import re
 
def get_code(num):
    print 'get page...'
    url = 'http://www.c.happycodings.com/code_snippets/code%d.html' % num

src/s/h/shingetsu-HEAD/saku/trunk/shingetsu/crond.py   shingetsu(Download)
import sys
import time
from threading import Thread
from urllib import urlopen
 
import config
 
            else:
                sys.stderr.write("Error: openport failed: %s\n" % self.router)
        try:
            con = urlopen("http://localhost:%d%s" %
                          (config.port, config.client),
                          proxies={})
            con.close()

src/d/y/dynts-HEAD/dynts/data/gy.py   dynts(Download)
import os
import csv
from urllib import urlopen
try:
    import httplib2
except:
    httplib2 = None
    def request(self, url):
        if self.h:
            resp, content = self.h.request(url)
            if resp.status == 200:
                return resp
        else:
            return urlopen(url, proxies = settings.proxies)

src/d/y/dynts-0.2/dynts/data/gy.py   dynts(Download)
import os
import csv
from urllib import urlopen
import numpy as ny
try:
    import httplib2
except:
    def request(self, url):
        if self.h:
            resp, content = self.h.request(url)
            if resp.status == 200:
                return resp
        else:
            return urlopen(url, proxies = settings.proxies)

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