zoukankan      html  css  js  c++  java
  • 【Python学习】python操作excel超链接

    = HYPERLINK(“{}”,“{}”)’.format(链接,“链接名称”)

    import xlwt
    
    wb = xlwt.Workbook()
    ws = wb.add_sheet('test')

    # 链接
    style = xlwt.easyxf('font: name Times New Roman, color-index red, bold on',
    num_format_str='#,##0.00')
    al = xlwt.Alignment()
    al.horz = 0x02 # 设置水平居中
    al.vert = 0x01 # 设置垂直居中
    style.alignment = al

    # 链接
    # write_table_of_sheet0.write(11, 2, u"=HYPERLINK("#详情!a1", "详情") ", hyper_style)
    # write_table_of_sheet0.write(13, 2, u"=HYPERLINK("#链接!a1", "链接") ", hyper_style)
    write_table_of_sheet0.write(11, 2, xlwt.Formula(u"HYPERLINK("#详情!a1", "详情") "), hyper_style)
    write_table_of_sheet0.write(13, 2, xlwt.Formula(u"HYPERLINK("#链接!a1", "链接") "), hyper_style)

     
    作者:gtea 博客地址:https://www.cnblogs.com/gtea
  • 相关阅读:
    2016年第七届蓝桥杯C/C++ A组国赛 —— 第一题:随意组合
    寻找段落
    攻击火星
    图论入门
    实数加法
    求 10000 以内 n 的阶乘
    大整数因子
    计算2的N次方
    大整数减法
    大整数加法
  • 原文地址:https://www.cnblogs.com/gtea/p/12751363.html
Copyright © 2011-2022 走看看