Page 72 - Python Cơ Bản
P. 72
import redis
r = redis.StrictRedis(host='localhost', port=6379,
db=0)
8LрG LMЖR PЖRL
8LрG LMЖR GɨG PЖRL FɳRL XLЬRK XVɱR чРM XвRK VIHMW :ɴ Hд
import redis
r = redis.StrictRedis(...)
r.set('foo', 'bar')
print r.get('foo')
(HiӅn thӍ 'bar')
4MTIPMRI
4MTIPMRI Pɧ Oц XLYϼX чвG HɽRK XVSRK XVЬRK LвT FϰR QYРR
XʆRK TIVJSVQERGI FЮM KШT RLMАY PЖRL ZɧS QШX VIUYIWX XLE]
Zɳ QЦM PЖRL Pɧ QШX VIUYIWX RL XLɺRK XLЬRK <IQ Zɴ Hд
WEY чВ LMВY GɨGL Wм HдRK TMTIPMRI FЀRK redis-py