본문 바로가기

programming/python

(3)
matplotlib의 plot() 실행 시, kernel shutdown 될 때 대응 방법 jupyter notebook에서 matplotlib의 plot( ) 실행 시, 항상 kernel이 죽으면서 아래 메시지가 콘솔에 출력됐다. OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a sin..
C++ 응용프로그램에 파이썬 인터프리터 내장하기 (Qt 기반) 사용한 개발환경 Windows 10 Home 64bit Qt 5.12.3 python v3.5.0 64bit 절차 Qt 프로젝트 파일 설정 Qt의 프로젝트 파일(.pro)에 설치된 python의 경로를 아래와 같이 INCLUDEPATH와 LIBS를 지정해준다. (python3가 C:/Python35/ 에 설치되었다고 가정하면,) .... FORMS += \ DlgMain.ui INCLUDEPATH = C:\Python35\include LIBS += -LC:\Python35\libs -lpython35 # Default rules for deployment. .... slots 키워드 충돌 방지 python.h 헤더파일과 Qt의 slots 키워드가 충돌한다. 이를 방지하기 위해, python.h를 직접 ..
함수 매개변수 문법 정리 - python과 javascript # 함수 매개변수 문법 정리 : 2018.03.04 asoe72 --------------------------------------- ## python ### 기본 인수 값 인수를 넘겨주지 않아도 자신의 기본값을 취한다. def incr(a, step=1): return a + step >>> b = 1 >>> b = incr(b) # 1 증가 >>> b 2 >>> b = incr(b, 10) # 10 증가 >>> b 12 ### 키워드 인수 순서가 아닌 인수 이름으로 값을 전달. def area(height, width): return height * width a = area(width=20, height=10) # 200 b = area(height='ha ', 3) # ha ha ha 키워드 인..