當前位置:編程學習大全網 - 網站源碼 - python用xlwt,超鏈接到另壹sheet,如何設置HYPERLINK

python用xlwt,超鏈接到另壹sheet,如何設置HYPERLINK

我這裏運行的很好,沒有錯誤提示,打開顯示也正常。

運行環境是:Python 3.50,Excel 2007

import?xlwt

book?=?xlwt.Workbook()

sheet_index?=?book.add_sheet('index')

line=0

for?i?in?range(9):

sheet1?=?book.add_sheet(str(i))

sheet1.write(0,0,str(i))

link?=?'HYPERLINK("#%s";"%s")'?%?(str(i),?str(i))

sheet_index.write(line,?0,?xlwt.Formula(link))

line+=1

book.save('simple2.xls')

  • 上一篇:創高體育為什麽跑步數據會出現異常
  • 下一篇:如何把kindEditor編輯好的內容添加到mysql數據庫中
  • copyright 2024編程學習大全網