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 | 29 |
| 30 |
Tags
- nvidia-smi
- 오류
- paramiko
- windows forms
- C#
- VS Code
- C
- mysql
- 핑거스타일
- 컨테이너
- Visual Studio
- 프로그래머스
- pip
- Selenium
- pytorch
- pandas
- C++
- ubuntu
- error
- SSH
- Python
- 채보
- YOLO
- JSON
- Docker
- Numpy
- label
- OpenCV
- Linux
- 기타 연주
Archives
- Today
- Total
목록config file (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, lines ..
Python
2025. 1. 21. 22:41