This commit is contained in:
dsyoon
2022-08-10 00:42:03 +09:00
parent 62e0deecfe
commit 2564871ff8
6 changed files with 116 additions and 21 deletions

View File

@@ -85,7 +85,7 @@ class HTS:
def currentStock(self, stock_code):
# 현재가 객체 구하기
self.objStockMst = win32com.client.Dispatch("DsCbo1.StockMst")
self.objStockMst.SetInputValue(0, 'A'+stock_code) # 종목 코드 - 삼성전자
self.objStockMst.SetInputValue(0, 'A'+stock_code) # 종목 코드
self.objStockMst.BlockRequest()
# 현재가 통신 및 통신 에러 처리
@@ -568,6 +568,19 @@ class HTS:
print("update...", stock_code, ymd)
return
def makeLabel(self, db_filename, stock_code, ymd, hms, label):
tableName = 'hts'
conn = sqlite3.connect(db_filename)
cursor = conn.cursor()
cursor.execute('Update ' + tableName + ' set label=? WHERE CODE=? and ymd=? and hms=?', (label, stock_code, ymd, hms,))
conn.commit()
cursor.close()
conn.close()
print("update...", stock_code, ymd, hms, label)
return
def getYMD(self, stock_code):
tableName = 'hts'
conn = sqlite3.connect(os.path.join(self.RESOURCE_PATH, "hts.db"))