본문 바로가기

전체 글847

주짓수 인버티드 데라히바(Inverted Derahiva) 주짓수인버티드 데라히바 2016. 12. 14.
대전 주짓수/킥복싱 스턴건짐 김동현선수가 운영하는 대전 스턴건짐 도장에서 판매하는 도복 운동 시간표 3개월 등록 시 입관료가 면제된다.주짓수 도복은 운동복 대여가 불가능하므로 구입하거나 노기주짓수를 이용해야 한다. 등록하면 주는 카드. 올 때 마다 찍고 이용해야 한다.16. 12. 14 화요일 시작 2016. 12. 13.
파이썬 한글 인코딩 문제 해결 >>> t = (('테스트',100),('한글',200))>>> t(('\xed\x85\x8c\xec\x8a\xa4\xed\x8a\xb8', 100), ('\xed\x95\x9c\xea\xb8\x80', 200))>>> print t(('\xed\x85\x8c\xec\x8a\xa4\xed\x8a\xb8', 100), ('\xed\x95\x9c\xea\xb8\x80', 200))>>> print repr(t).decode('string-escape')(('테스트', 100), ('한글', 200)) 2016. 12. 8.
multiprocessing 간 전역변수 공유 multiprocessing으로 프로그램을 실행시키면 스레드와는 달리 완전히 독립된 새로운 프로세스가 실행되기 때문에전역변수를 공유할 수 없다. 2016. 12. 7.
파이썬 multiprocessing 파이썬은 GIL 때문에 멀티스레드로 프로그램을 구성해도 실제로는 한번에 하나의 스레드가 time-sharing하는 형태로 실행된다. -> multiprocessing 모듈을 사용하여 해결가능 [ex code]from multiprocessing import Processimport time class test:def a(self):for i in range(0,5):print 'a'time.sleep(1)def b(self):for i in range(0,5):print 'b'time.sleep(1) if __name__ == '__main__':go = test()p1 = Process(target=go.a)p2 = Process(target=go.b)p1.start()p2.start() 2016. 12. 5.
ascii' codec can't decode byte 0xed in position 0: ordinal not in range(128) 에러 한글관련 처리하다가 ascii' codec can't decode byte 0xed in position 0: ordinal not in range(128) 와 같이에러가 발생하는 경우가 생겼다. 보통 최상단에 #-*- coding: utf-8 -*- 를 써주면 해결이 됐는데이번에는 여전히 에러가 발생했다.이럴 경우 아래와 같은 방법으로 해결할 수 있다. import sysreload(sys)sys.setdefaultencoding('utf8') 2016. 12. 5.