본문 바로가기 메뉴 바로가기

jadore happy life

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

jadore happy life

검색하기 폼
  • 분류 전체보기 (27)
    • redis (3)
    • processing (7)
    • zeroMQ (0)
    • wordpress (1)
    • DigitalOcean (0)
    • spark (0)
    • C++ (1)
    • Linux (0)
    • Docker (0)
    • R (0)
    • Utility (0)
    • Java (0)
    • Scala (0)
    • Node.js (0)
    • Oracle Database (0)
    • life (2)
    • python (3)
    • arduino (5)
    • rust (0)
  • 방명록

python에서 redis 사용시 "b" 문자 이슈

python에서 redis 연결하여 사용할 경우 "b" 문자가 출력됨 >>> r = redis.StrictRedis(host='localhost', port=6379, db=0) >>> r.set('test_redis', 'Hello Python') >>> r.get('test_redis')b'Hello Python' --> byte 문자열이란 뜻으로 해결을 위해서는 다음 unicode를 명시적으로 사용하여 수정함.>>> r = redis.StrictRedis(host="localhost", port=6379, charset="utf-8", decode_responses=True) >>> r.set('test_redis', 'Hello Python') >>> r.get('test_redis')

redis 2016. 5. 16. 11:15
python에 redis 라이브러리 설치

$ pip install redis$ easy_install redis위의 두가지 방법중에 하나 선택하여 진행

redis 2016. 5. 16. 08:06
Coding the Matrix -3장 Vector(추가)

In [11]: class Vec: def __init__(self, labels, function): self.D=labels self.f=functionv=Vec(['A', 'B', 'C'], {'A':1})​for d in v.D: if d in v.f: print(v.f[d])​def zero_vec(D): return Vec(D, {d:0 for d in D})​d={1,2,3,4,5,6,7,8}dp = zero_vec(d)print(dp) 1 In [34]: class Vec: def __init__(self, labels, function): self.D=labels self.f=functionv=Vec(['A', 'B', 'C'], {'A':1})​def setitem(v, d, val) ..

python 2016. 5. 15. 17:52
이전 1 2 3 4 5 6 7 8 9 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • 파일
more
«   2025/12   »
일 월 화 수 목 금 토
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바