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

All Samples(4112)  |  Call(3857)  |  Derive(0)  |  Import(255)
loads(string) -- Load a pickle from the given string

src/p/y/python-cookbook-HEAD/cb2_examples/cb2_7_12_sol_1.py   python-cookbook(Download)
sql = 'SELECT name, ablob FROM justatest ORDER BY name'
cursor.execute(sql)
for name, blob in cursor.fetchall():
    print name, cPickle.loads(blob), cPickle.loads(data[name])
# Done, close the connection (would be no big deal if you didn't, but...)
connection.close()
 

src/p/y/python-cookbook-HEAD/cb2_examples/cb2_7_11_sol_1.py   python-cookbook(Download)
    sql = "SELECT name, ablob FROM justatest ORDER BY name"
    cursor.execute(sql)
    for name, blob in cursor.fetchall():
        print name, cPickle.loads(blob), cPickle.loads(data[name])
finally:
    # Done. Remove the table and close the connection.
    cursor.execute("DROP TABLE justatest")

src/p/y/python-cookbook-HEAD/cb2_examples/cb2_7_10_sol_1.py   python-cookbook(Download)
    sql = "SELECT name, ablob FROM justatest ORDER BY name"
    cursor.execute(sql)
    for name, blob in cursor.fetchall():
        print name, cPickle.loads(blob), cPickle.loads(data[name])
finally:
    # Done. Remove the table and close the connection.
    cursor.execute("DROP TABLE justatest")

src/p/y/python-cookbook-HEAD/cb2_examples/cb2_7_6_sol_1.py   python-cookbook(Download)
    # serialize the function's code object to a string of bytes
    pickled_code = cPickle.dumps(f.func_code)
    # recover an equal code object from the string of bytes
    recovered_code = cPickle.loads(pickled_code)
    # build a new function around the rebuilt code object
    g = new.function(recovered_code, globals())
    # check what happens when the new function gets called

src/p/y/python-cookbook-HEAD/cb2_examples/cb2_7_4_sol_1.py   python-cookbook(Download)
import cPickle
class ForExample(object):
    def __init__(self, *stuff):
        self.stuff = stuff
anInstance = ForExample('one', 2, 3)
saved = cPickle.dumps(anInstance)
reloaded = cPickle.loads(saved)

src/p/r/protocyt-HEAD/protocyt/examples/benchmark/main.py   protocyt(Download)
        def test_loads(data):
            pickle.loads(data)
 
 
        ba = bytearray()
        tree.serialize(ba)
        data = pickle.dumps(tree, 2)

src/m/o/mocop-HEAD/trunk/tools/samplejsonrpcclient.py   mocop(Download)
prm = base64.encodestring(zlib.compress(cPickle.dumps(('JSON_RPC CLIENT WORKS',), )))
kw = base64.encodestring(zlib.compress(cPickle.dumps({}, )))
result = s.run(sessionID, "base.controllers.test.Test:cik", prm, kw)
print 'Result:', cPickle.loads(zlib.decompress(base64.decodestring(result)))
 

src/m/o/mocop-HEAD/tools/samplejsonrpcclient.py   mocop(Download)
prm = base64.encodestring(zlib.compress(cPickle.dumps(('JSON_RPC CLIENT WORKS',), )))
kw = base64.encodestring(zlib.compress(cPickle.dumps({}, )))
result = s.run(sessionID, "base.controllers.test.Test:cik", prm, kw)
print 'Result:', cPickle.loads(zlib.decompress(base64.decodestring(result)))
 

src/p/r/protocyt-0.1/protocyt/examples/benchmark/main.py   protocyt(Download)
        def test_loads(data):
            pickle.loads(data)
 
 
        ba = bytearray()
        tree.serialize(ba)
        data = pickle.dumps(tree, 2)

src/g/d/gdata_sample-HEAD/oauth/views.py   gdata_sample(Download)
def home(request):
    token_search = GoogleAccount.objects.filter(user = request.user)\
        .order_by('-ctime')
    if token_search:
        token_db_object = token_search[0]
        token = Pickle.loads(str(token_db_object.data))
        client = gdata.contacts.service.ContactsService()

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