"Pykioom"의 두 판 사이의 차이
DB CAFE
(→opw0004) |
(→opw0004) |
||
28번째 줄: | 28번째 줄: | ||
for column in df.columns: | for column in df.columns: | ||
print(column, df.loc[0][column]) | print(column, df.loc[0][column]) | ||
+ | </source> | ||
+ | |||
+ | === opw00018 single === | ||
+ | <source lang=python> | ||
+ | # TR/opw00018 | ||
+ | from pykiwoom.kiwoom import * | ||
+ | |||
+ | # 로그인 | ||
+ | kiwoom = Kiwoom() | ||
+ | kiwoom.CommConnect(block=True) | ||
+ | |||
+ | # 계좌번호는 11을 붙여서 10자리임 | ||
+ | account_list = kiwoom.GetLoginInfo("ACCNO") | ||
+ | account = account_list[0] | ||
+ | print(account) | ||
+ | |||
+ | # opw00018 요청 (싱글데이터) | ||
+ | df = kiwoom.block_request("opw00018", | ||
+ | 계좌번호=account, | ||
+ | 비밀번호="", | ||
+ | 비밀번호입력매체구분="00", | ||
+ | 조회구분=2, | ||
+ | output="계좌평가결과", | ||
+ | next=0) | ||
+ | |||
+ | print(df) | ||
+ | </source> | ||
+ | |||
+ | === opw00018 multi === | ||
+ | <source lang=python> | ||
+ | # TR/opw00018 | ||
+ | from pykiwoom.kiwoom import * | ||
+ | |||
+ | # 로그인 | ||
+ | kiwoom = Kiwoom() | ||
+ | kiwoom.CommConnect(block=True) | ||
+ | |||
+ | # 계좌번호는 11을 붙여서 10자리임 | ||
+ | account_list = kiwoom.GetLoginInfo("ACCNO") | ||
+ | account = account_list[0] | ||
+ | print(account) | ||
+ | |||
+ | # opw00018 요청 | ||
+ | df = kiwoom.block_request("opw00018", | ||
+ | 계좌번호=account, | ||
+ | 비밀번호="", | ||
+ | 비밀번호입력매체구분="00", | ||
+ | 조회구분=2, | ||
+ | output="계좌평가잔고개별합산", | ||
+ | next=0) | ||
+ | |||
+ | print(df) | ||
+ | df.to_excel("opw00018.xlsx") | ||
</source> | </source> |
2020년 11월 16일 (월) 08:58 판
thumb_up 추천메뉴 바로가기
- DBA { Oracle DBA 명령어 > DBA 초급 과정 > DBA 고급 과정 }
- 튜닝 { 오라클 튜닝 목록 }
- 모델링 { 데이터 모델링 가이드 }
1 opw0004[편집]
# TR/opw00004
from pykiwoom.kiwoom import *
# 로그인
kiwoom = Kiwoom()
kiwoom.CommConnect(block=True)
# 계좌번호는 11을 붙여서 10자리임
account_list = kiwoom.GetLoginInfo("ACCNO")
account = account_list[0]
print(account)
# opw00001 요청
df = kiwoom.block_request("opw00004",
계좌번호=account,
비밀번호="",
상장폐지조회구분=0,
비밀번호입력매체구분="00",
output="계좌평가현황",
next=0)
print(df)
for column in df.columns:
print(column, df.loc[0][column])
2 opw00018 single[편집]
# TR/opw00018
from pykiwoom.kiwoom import *
# 로그인
kiwoom = Kiwoom()
kiwoom.CommConnect(block=True)
# 계좌번호는 11을 붙여서 10자리임
account_list = kiwoom.GetLoginInfo("ACCNO")
account = account_list[0]
print(account)
# opw00018 요청 (싱글데이터)
df = kiwoom.block_request("opw00018",
계좌번호=account,
비밀번호="",
비밀번호입력매체구분="00",
조회구분=2,
output="계좌평가결과",
next=0)
print(df)
3 opw00018 multi[편집]
# TR/opw00018
from pykiwoom.kiwoom import *
# 로그인
kiwoom = Kiwoom()
kiwoom.CommConnect(block=True)
# 계좌번호는 11을 붙여서 10자리임
account_list = kiwoom.GetLoginInfo("ACCNO")
account = account_list[0]
print(account)
# opw00018 요청
df = kiwoom.block_request("opw00018",
계좌번호=account,
비밀번호="",
비밀번호입력매체구분="00",
조회구분=2,
output="계좌평가잔고개별합산",
next=0)
print(df)
df.to_excel("opw00018.xlsx")