Change Excel column widths with Python

preview_player
Показать описание
This is a short example of how to change column widths in Excel (xlsx) files using Python Openpyxl.
Рекомендации по теме
Комментарии
Автор

Thank you so much. I am a beginner and couldn't find this solution. Tried all sorts of stuff in pandas, didn't know it was this easy.

ingydegmar
Автор

Is it possible to change a range of column widths to the same value? I know the following doesn't work :. "sheet.column_dimensions['A' : 'B'].width = 4 " , but is there a way to specify a column range in a single line?

richardhunter