Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- VS Code
- Selenium
- C#
- paramiko
- mysql
- 오류
- 기타 연주
- 채보
- error
- YOLO
- Docker
- Visual Studio
- Linux
- pandas
- OpenCV
- 컨테이너
- 프로그래머스
- pip
- pytorch
- SSH
- JSON
- LIST
- 핑거스타일
- windows forms
- C++
- C
- Numpy
- Python
- label
- ubuntu
Archives
- Today
- Total
목록주석 유지 (1)
기계는 거짓말하지 않는다
Python configparser config file 주석(comment) 유지
Python의 configparser 모듈로 config file을 읽고 쓰면 config file의 주석은 유지되지 않는다.주석을 유지해야 할 때, 가능하도록 간단히 구현한 예시이다.import configparserdef read_config_with_comments(file_path): """config file과 config file의 line을 함께 read""" with open(file_path, 'r') as file: lines = file.readlines() config = configparser.ConfigParser(allow_no_value=True) config.read(file_path) return config, linesdef wri..
Python
2025. 1. 21. 22:41