開発環境
- macOS Mojave - Apple (OS)
- Emacs (Text Editor)
- Windows 10 Pro (OS)
- Visual Studio Code (Text Editor)
- Python 3.7 (プログラミング言語)
入門 Python 3 (Bill Lubanovic (著)、斎藤 康毅 (監修)、長尾 高弘 (翻訳)、オライリージャパン)の8章(データの行き先)、8.7(復習問題)8-11、12.を取り組んでみる。
コード(Emacs)
Python 3
#!/usr/bin/env python3
import redis
print('11.')
conn = redis.Redis()
conn.hmset('test', {'count': 1, 'name': 'Fester Besterester'})
print(conn.hgetall('test'))
print('12.')
conn.hincrby('test', 'count')
print(conn.hgetall('test'))
入出力結果(Terminal, cmd(コマンドプロンプト), Jupyter(IPython))
$ ./sample11.py
11.
{b'count': b'1', b'name': b'Fester Besterester'}
12.
{b'count': b'2', b'name': b'Fester Besterester'}
$
0 コメント:
コメントを投稿