컴퓨터/Python

Python]ConfigParser를 이용한 ini 파일 읽기

예섬수진 2010. 1. 20. 16:32
1. ini 파일 예제

※ ini 파일에서 []부분이 없다면, 파일 read() 시 Exception Error가 발생함

2. 위와 같은 ini 파일에서 이름에 대한 값을 콕! 가져오려면 어떻게 해야 할까 ?
- ConfigParser를 이용하면 된다.
※ Python 3.0부터는 configparser로 명칭이 변경되었음

※ ConfigParser : http://docs.python.org/library/configparser.html