본문 바로가기

언어/Python

stream 및 file에 로그 남기기 (logging) 출처: http://gyus.me/?p=418 / https://inma.tistory.com/136 파이썬 표준 라이브러리인 logging을 활용하여 로그를 남기는 방법에 대해 알아봅니다. [방법1] stream에 로그 남기기 - 스트림(콘솔)에 로그를 찍기 위해 logging을 사용합니다. import logging logging.info('my INFO log') logging.warning('my WARNING log') # WARNING:root:my WARNING log 위 코드를 실행하면 warning level만 출력되는 이유? - logging의 default log level이 warning으로 되어있기 때문입니다. 다음 처럼 logging의 basicConfig level을 변경하면 .. 더보기
PC / RPi camera display using PyQt and OpenCV 출처: https://iosoft.blog/2019/07/31/rpi-camera-display-pyqt-opencv/ PC / RPi camera display using PyQt and OpenCV OpenCV is an incredibly powerful image-processing tool, but it can be difficult to know where to start – how do you grab an image from a camera, and display it in a user-friendly GUI? This po… iosoft.blog OpenCV is an incredibly powerful image-processing tool, but it can be difficult .. 더보기
PyQt serial terminal 출처: https://iosoft.blog/2019/04/30/pyqt-serial-terminal/ PyQt serial terminal A simple demonstration of threading in PyQt I do a lot of work with serial comms; TeraTerm is an excellent serial terminal, but sometimes a customised application is required, for example when deal… iosoft.blog A simple demonstration of threading in PyQt I do a lot of work with serial comms; TeraTerm is an excellent se.. 더보기
Windows에서 PyCharm을 사용하여 Python2와 Python3 동시에 사용하기 출처: http://webnautes.tistory.com/1205 2018. 7. 11 - 최초 작성 1. Python 설치 다음 포스팅을 참고하여 Python2와 Python3를 설치해주세요. 설치시 Path를 등록안해도 상관은 없지만 자주 사용하는 버전만 등록해주는 것이 좋습니다. Windows에 Python2, Python3 설치 하는 방법http://webnautes.tistory.com/1202 2. PyCharm 설치 1. 아래 링크에서 커뮤니티 버전을 다운로드받습니다.https://www.jetbrains.com/pycharm/download/#section=windows 2. PyCharm을 사용하려면 JRE가 설치되어 있어야 합니다. PyCharm 설치 진행시 Download and i.. 더보기
Windows에 Python2, Python3 설치 하는 방법 출처: http://webnautes.tistory.com/1202 Windows 10에 Python2와 Python3를 설치하는 방법을 소개합니다. 배포 중인 최신 버전이 글 작성 시점과 다를 수 있습니다. 1. Python 3 설치 2. Python 2 설치 3. Python 2와 Python 3 함께 사용하기 2018. 7. 5 - 최초 작성.2018. 7. 11 - Python 2 설치 방법 추가 애초에 Python 3를 위한 문서를 작성했는데 Python 2를 무시할 수 없는 상황이라 관련 내용을 추가했습니다. Python 3가 처음 릴리즈된 2008년부터 현재까지 파이썬 공식 홈페이지(https://www.python.org/ )에서는 Python 2와 Python 3를 따로 배포하고 있습니다.. 더보기
RPi_GPIO_Code_Samples https://www.linuxsecrets.com/elinux-wiki/RPi_GPIO_Code_Samples.html A simple app for controlling GPIO pin 17 with LazarusThe GPIO pins are accessible from Lazarus without any third-party software. This is performed by means of the BaseUnix unit that is part of every distribution of Lazarus and Free Pascal or by invoking Unix shell commands with fpsystem. The following example uses GPIO pin 17 as.. 더보기