Python - Automatically adjust width of an excel file's columns

后端 未结 6 1562
夕颜
夕颜 2021-02-01 22:15

Newbie - I have a Python script that adjusts the width of different columns of an excel file, according to the values specified:

import openpyxl
from string impo         


        
6条回答
  •  情歌与酒
    2021-02-01 22:31

    If possible you should determine the length of the longest entry in the column and use that to set the width.

    I'm assuming you can make use of for entry in ascii_uppercase.

    I'm on mobile atm so can't give a concrete code example but what I said before should help you get closer to what you want to achieve.

提交回复
热议问题