from HKStock import *
import xlwings as xw

code = input("请输入港股代码(不可省略前0):")
years = input("请输入下载年份，以英文逗号分隔:")

t = r'Template.xlsx'
b = balance_data(code,years)
p = income_data(code,years)
c = cash_data(code,years)

bk = xw.Book(t)
bk.sheets['balance_data'].clear_contents()
xw.view(b,bk.sheets['balance_data'])
#bk.sheets['cash_data'].clear_contents()
#xw.view(c,bk.sheets['cash_data'])
#bk.sheets['income_data'].clear_contents()
#xw.view(p,bk.sheets['income_data'])

bk.save(str(code)+'.xlsx')
xw.apps[0].quit()