configparser
-
실행프로그램의 설정값 입력받는 방법 (configparse, argparser)네이버 Boostcamp AI tech 4기 2022. 10. 27. 23:36
1. configparser 프로그램의 실행 설정을 file에 저장 Section, Key, Value 값의 형태로 설정된 설정 파일을 사용 설정 파일을 Dict Type으로 호출 후 사용 config file (확장자 .cfg) [SectionOne] # Section - 대괄호 Status: Single # 속성 - Key : Value Name: Derek Value: Yes Age: 30 [SectionTwo] FavoriteColor = Green # :(콜론)을 써도 되고, =(equal)을 써도 된다. [SectionThree] FamilyName: Johnson configparser.py import configparser config = configparser.ConfigParser()..