Contents
- Install
- Initialize Configurations
- Additional Configurations
- Basic Debugging
- Breakpoints and logpoints
1. Install
VSCode Marketplace에서 Python 검색 후 Python Debugger 설치
2. Initialize Configurations
- [Run and Debug] 버튼 밑에 있는 [create a launch.json file.] 선택
- Python Debugger 선택
- Python File 선택
3. Additional Configurations (Optional)
- 왼쪽 사이드바에서 아래화살표 선택 후 [Add configuration ... ] 선택
- 실행중인 Python 파일이 아닐 경우 프로세스 ID를 가져와서 디버거를 실행시킬 수 있다.
이 경우 Python Debugger: Debug Python File > Attach using Process ID 선택
4. Basic Debugging
- Python Debugger: Debug Python File. 선택
5. Breakpoints and logpoints
- Editor 상의 Line number 옆에 빨간 점을 생성하여 Breakpoint를 지정할 수 있다. 주로 분기문 앞에 사용하면 좋다.
Reference
Visual Studio Code Docs : Python > Debugging
- 끝 -
'개발노트' 카테고리의 다른 글
PyTorch (1) | 2024.05.17 |
---|---|
Tensorboard를 통한 pbtxt 파일 시각화 (0) | 2024.05.14 |
Macbook Pro M3에서 Homebrew를 이용한 Anaconda / Tensorflow 설치 (0) | 2024.05.14 |
Python Opencv: findContours 함수 살펴보기 (0) | 2024.05.09 |
Git Convention: Commit Message 작성하는 방법 (0) | 2024.05.08 |