728x90 반응형 Python286 [Python] Ex: Relative Path Import 시 주의할 점 다음은 main script 등에서 relative path import를 사용할 때,__name__을 기준으로 삼기 때문에 주의해야 점을 발생 가능한 문제를 예를 들어서 설명하는 문서임. 참고: 패키지 컨텍스트(package context)Python 모듈이 자신이 속한 패키지 구조 내에서의 위치와 관계를 인식하는 상태를 가리킴: 이는 모듈의 __name__ 값으로 확인 가능.예제 디렉토리 구조my_package/ __init__.py main.py subpackage/ __init__.py module_a.py module_b.py코드 예제1. module_a.py:# my_package/subpackage/module_a.pydef greet().. 2024. 6. 4. [PySide] Ex: Img Viewer. QListWidget and Matplotlib PySide를 사용하여 QListWidget과 Matplotlib 연동하기이 글에서는 PySide6를 사용하여 QListWidget과 Matplotlib를 이용하여 Image viewer를 만드는 방법을 설명함. 사용자는 디렉토리에서 PNG 파일을 선택하고선택한 이미지를 Matplotlib를 사용하여 표시할 수 있음. 예제 코드를 통해 이를 구현하는 방법을 단계별로 살펴보겠음.프로젝트 설정먼저 PySide6와 Matplotlib를 설치해야 함. 이를 위해 아래의 명령어를 실행하기 바람.pip install PySide6 matplotlib주요 클래스 및 메서드 소개ImageCanvas 클래스ImageCanvas 클래스는 Matplotlib의 FigureCanvasQTAgg를 상속하여 이미지를 표시하는 기.. 2024. 6. 4. [Python] PIL, Pillow, OpenCV, and Scikit-image PIL, Pillow, OpenCV, and Scikit-imagePython에서 이미지를 다룰 때 이용되는 주요 패키지들은 다음과 같음.1.PIL (Python Imaging Library)PIL은 1995년에 처음 개발(Fredrik Lundh)된 Python의 최초 이미지 처리 라이브러리 중 하나임.매우 직관적이고 사용하기 쉬운 API를 제공하여 많은 개발자들에게 사랑받았음.그러나 2009년 이후로 더 이상 업데이트가 되지 않아 최신 Python 버전과 호환성 문제가 발생했음.공식 사이트: PIL 공식 사이트더보기Fredrik Lundh는 2013년 이후로는 거의 공개적인 개발활동이나 온라인 커뮤니티에서 활동을 찾기 어려움.돌아가시진 않은 거 같은데... disappeared 상태.2.PillowP.. 2024. 6. 3. [matplotlib] Summary : 작성중 Introduction2024.03.04 - [Python/matplotlib] - [matplotlib] matplotlib란 [matplotlib] matplotlib란Matplotlib은 Python에서 가장 널리 사용되는 Data Visualization Library임. matplotlib를 통해 chart(차트),image(이미지) 및,다양한 visual representation of data이 가능함.pyplot 모듈을 통해 공학 계산 및 visualization으로ds31x.tistory.comvisualization2024.01.22 - [Python/matplotlib] - [matplotlib] Visualization: Graph, Chart, Diagram, Figure [mat.. 2024. 6. 3. [matplotlib] Object Oriented Style Tutorial Matplotlib Object Oriented Style Tutorial1. IntroductionMatplotlib은 Python의 2D plotting library로, 다양한 그래프와 플롯을 생성하는 데 사용됨.2024.03.04 - [Python/matplotlib] - [matplotlib] matplotlib란 [matplotlib] matplotlib란Matplotlib은 Python에서 가장 널리 사용되는 Data Visualization Library임. matplotlib를 통해 chart(차트),image(이미지) 및,다양한 visual representation of data이 가능함.pyplot 모듈을 통해 공학 계산 및 visualization으로ds31x.tistory.com.. 2024. 6. 3. [matplotlib] Tutorial: Scripting Style Tutorial: Scripting Style 이 문서는 matplotlib.pyplot의 script 방식에 대한 간단한 튜토리얼임. scripting style에 대해서 잘 모르면 다음을 읽어볼 것.2024.06.02 - [Python/matplotlib] - [matplotlib] Scripting Layer vs. Artist Layer [matplotlib] Scripting Layer vs. Artist LayerScripting Layer vs. Artist LayerMatplotlib는Scripting Layer와 (이를 이용시 scripting style 이라고 불림)Artist Layer 라는 (이를 이용시 object-oriented style 이라고 불림)두 가지 주요 인터페이스를.. 2024. 6. 3. 이전 1 ··· 24 25 26 27 28 29 30 ··· 48 다음 728x90 반응형