### Login with Kiwoom API Source: https://github.com/sharebook-kr/pykiwoom/blob/master/README.md Demonstrates how to initialize the Kiwoom API wrapper and connect to the service. It uses `CommConnect` to establish a connection, with `block=True` indicating a synchronous operation. ```Python from pykiwoom.kiwoom import * kiwoom = Kiwoom() kiwoom.CommConnect(block=True) ``` -------------------------------- ### Handle Continuous TR Queries with KiwoomManager Source: https://github.com/sharebook-kr/pykiwoom/blob/master/README.md Demonstrates how to perform continuous TR queries using `KiwoomManager`. It shows how to set the 'next' parameter to '2' for subsequent requests after retrieving data, allowing for fetching multiple pages or related data sets. ```Python from pykiwoom.kiwoom import * if __name__ == "__main__": km = KiwoomManager() tr_cmd = { 'rqname': "opt10081", 'trcode': 'opt10081', 'next': '0', 'screen': '1000', 'input': { "종목코드": "005930", "기준일자": "20200424", "수정주가구분": "", }, 'output': ["일자", "시가", "고가", "저가", "현재가"] } for i in range(2): if i != 0: tr_cmd['next'] = '2' km.put_tr(tr_cmd) data = km.get_tr() print(data) ``` -------------------------------- ### KiwoomManager for Subprocess Operations Source: https://github.com/sharebook-kr/pykiwoom/blob/master/README.md Explains how to use `KiwoomManager` to run Kiwoom functionalities in a separate subprocess, enabling better separation between the user program and the Kiwoom API client. ```Python from pykiwoom.kiwoom import * if __name__ == "__main__": km = KiwoomManager() km.put_method(("GetMasterCodeName", "005930")) data = km.get_method() print(data) ``` -------------------------------- ### Submit TR Requests via KiwoomManager Source: https://github.com/sharebook-kr/pykiwoom/blob/master/README.md Illustrates sending a Transaction Request (TR) to the Kiwoom API using `KiwoomManager`. It defines the TR command with input parameters and expected output fields, then uses `put_tr` to send it and `get_tr` to retrieve the data. ```Python from pykiwoom.kiwoom import * if __name__ == "__main__": km = KiwoomManager() tr_cmd = { 'rqname': "opt10001", 'trcode': 'opt10001', 'next': '0', 'screen': '1000', 'input': { "종목코드": "005930" }, 'output': ['종목코드', '종목명', 'PER', 'PBR'] } km.put_tr(tr_cmd) data = km.get_tr() print(data) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.