[Python] DB per lista
Dario Bertini
berdario a gmail.com
Gio 6 Mar 2014 12:04:33 CET
>>> import redis
>>> r = redis.StrictRedis(host='localhost', port=6379, db=0)
>>> r.rpush
<bound method StrictRedis.rpush of
StrictRedis<ConnectionPool<Connection<host=localhost,port=6379,db=0>>>>
>>> r.rpush(0, "questa", "è", "una", "sequenza", "di", "stringhe")
6
>>> r.llen(0)
6
>>> r.lrange(0, -10, 10)
[b'questa', b'\xc3\xa8', b'una', b'sequenza', b'di', b'stringhe']
--
xmpp: berdario at gmail.com
bitmessage: BM-2cTYXfGiSTsnx3righ6aHcJSWe4MV17jDP
gpg fingerprint: 3F8D53518012716C4EEF7DF67B498306B3BF75A0 (used just
for signing commits)
Maggiori informazioni sulla lista
Python