文本框似乎没有出现(XlsxWriter)

2024-04-19 11:21:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我关注了XlsxWriter上的文档,但无法创建文本框。也许我错过了什么。以下是我的代码:

    packlist_name2 = "Packlist2_%s.xlsx" %(Machine_Serial.iloc[0]['2'])
    workbook = xlsxwriter.Workbook(packlist_name2)
    worksheet = workbook.add_worksheet('TextBox') 

    text = 'PACKLIST\n \n Serial No: \n ............'
    options = {'width': 2000,
       'height': 2000,
       'x_offset': 10,
       'y_offset': 10,
       'fill':{'color':'white'},
       'border': {'color': '#800000', 'width': 6, 'dash_type': 'solid'},
       'align' : {'horizontal':'center', 'vertical': 'middle'},
        'font': {'name': 'Times New Roman', 'size':36}
       }
   worksheet.insert_textbox('B2', text, options)

非常感谢您的帮助,谢谢!!你知道吗


Tags: 代码text文档serialwidthoffsetcoloroptions