SQL 파일을 저장하기 위해 구성 파일 (유형 .ini)을 사용하면 해당 키로 질의를받습니다. 모든 작업 벌금, 예를 들어, 매개 변수 쿼리를 만들 때까지파이썬 - 구성 파일 값에 % s 사용
;the ini file
product_by_cat = select * from products where cat =%s
내가 사용
은 그래서에서 문자열의 형식을 시도 :TypeError: not all arguments converted during string formatting
config = configparser.ConfigParser()
args= ('cat1')
config.read(path_to_ini_file)
query= config.get(section_where_are_stored_thequeries,key_of_the_query)
complete_query= query%args
내가 오류 ini 파일에서 값을 검색합니다. 내 문제에 대한 제안.