생활/대신증권API
대신증권 API 종목 불러오기
Alex_Lee
2020. 10. 6. 16:35
import win32com.client
#유가종목목록 튜플 형태로 리턴, 리턴타입 = tuple
def make_codeList():
#instCpCodeMgr이라는 CpUtil.CpCodeMgr 클래스의 객체 생성
instCpCodeMgr = win32com.client.Dispatch("CpUtil.CpCodeMgr")
#instCpCodeMgr을 이용해 CpUtil.CpCodeMgr 클래스의 객체 생성 메소드 GetStockListByMarket 호출
#GetStockListByMarket메소드에 인자로 1을 넣으면 유가종목 목록을 파이썬 튜플 형태로 리턴
codeList = instCpCodeMgr.GetStockListByMarket(1)
return codeList
참고출처: wikidocs.net/3682
위키독스
온라인 책을 제작 공유하는 플랫폼 서비스
wikidocs.net