python | 파이썬 configparser config Text 로딩
페이지 정보
작성자 굿스웹 작성일19-08-30 07:33 조회940회 댓글0건관련링크
본문
import #os
import #configparser
#ConfigParser 초기화
config = configparser.ConfigParser()
#ConfigFile 읽기
config.read(os.path.dirname(os.path.realpath(__file__)) + os.sep + 'config' + os.sep + 'setup.ini')
#메인 시작
if __name__ == "__main__":
#텍스트 파일 저장 경로
out_uid = config['Path']['userid']
out_upw = config['Path']['userpw']
[폴더 구조]
C:.
│ naver.py
│ naver.py.bak
│
└─config
setup.ini
setup.ini.bak
[출력화면]
C:\dev\g2>python naver.py
id:test
pw:1111
--
#파이썬 #python
[주소복사] https://www.goodsweb.kr/?u=D41uVYY8
SNS 알리기
핀터레스트
텔레그램로
블로그로
페이스북
트위터
카카오스토리
카톡 공유
관련 블로그
로딩중