開発環境
- OS X Yosemite - Apple (OS)
- Emacs (CUI)、BBEdit - Bare Bones Software, Inc. (GUI) (Text Editor)
- Python 3.4 (プログラミング言語)
Introducing Python: Modern Computing in Simple Packages(Bill Lubanovic (著)、 O'Reilly Media)のChapter 8(Data Has to Go Somewhere)、Things to Do 8.12.を解いてみる。
Things to Do 8.12.
コード(Eacs, BBEdit)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import redis
conn = redis.Redis()
conn.hmset('test', dict(count=1, name='Fester Bestertester'))
print(conn.hget('test', 'count'))
conn.hincrby('test', 'count')
print(conn.hget('test', 'count'))
入出力結果(Terminal, IPython)
$ ./sample12.py b'1' b'2' $
0 コメント:
コメントを投稿