<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _col_widths2xls(self, worksheets):
 """Writes col_widths to xls file Format: <col>\t<tab>\t<value>\n """


        xls_max_cols, xls_max_tabs = self.xls_max_cols, self.xls_max_tabs

        dict_grid = self.code_array.dict_grid

        for col, tab in dict_grid.col_widths:
            if col < xls_max_cols and tab < xls_max_tabs:
                pys_width = dict_grid.col_widths[(col, tab)]
                xls_width = self.pys_width2xls_width(pys_width)
                worksheets[tab].col(col).width = xls_width