How to use xlrd to find out the size of rows and columns. There is a method sheet.computed_column_width (1) - it determines the width of the column under the index 1, but wrong. How to get data for rows
1 answer
According to the documentation you can get information about rows and columns:
- line height will be in twips (1/20 points);
- the width of the column will be in units of 1/256 of the width of the zero character.
An example of code that displays information about row heights and column widths:
import xlrd rb = xlrd.open_workbook("style2003.xls", formatting_info=True) sheet = rb.sheet_by_index(0) w = sheet.computed_column_width(0) for i, row in sheet.rowinfo_map.items(): print("row {0} has {1} twip height".format(i, row.height)) for i, col in sheet.colinfo_map.items(): print("column {0} has {1} width".format(i, col.width)) |
размером строк и столбцов? What do you want to measure them? Measure specific rows and columns by index or find maximum size? - MaxU 2:58 pm