AGW Logo

xlsgrid functions

This is the description of standalone Python functions in the xlsgrid module.

method_summary Functions Summary


FontFromFont Creates a copy of the input font.
ReadExcelCOM Reads and Excel spreadsheet (a single worksheet) using Mark Hammonds’ pywin32
SplitThousands Splits a general float on thousands.

API Functions API



FontFromFont(font)[source]

Creates a copy of the input font.

Parameters:font – an instance of wx.Font.


ReadExcelCOM(filename, sheetname, rows, cols)[source]

Reads and Excel spreadsheet (a single worksheet) using Mark Hammonds’ pywin32 package. If this package is not available, it returns two empty nested lists.

Parameters:
  • filename – a valid Excel xls filename;
  • sheetname – the worksheet name inside the Excel file (i.e., the label on the workbook tab at the bottom of the workbook);
  • rows – the number of significant rows in the worksheet, as returned by xlrd;
  • cols – the number of significant columns in the worksheet, as returned by xlrd.
Returns:

two nested lists representing the comments (notes) on every cell and the WYSIWYG representation of the cell content.

Note

If Mark Hammonds’ pywin32 package is not available, this method returns two empty nested lists.



SplitThousands(s, tSep=', ', dSep='.')[source]

Splits a general float on thousands. GIGO on general input.

Parameters:
  • s – can be a float or a string, representing a number;
  • tSep – the character to be used as thousands separator;
  • dSep – the character to be used as decimal separator.
Returns:

a string properly formatted with thousands and decimal separators in it.

Note

This method is used only if Mark Hammonds’ pywin32 package is not available to try and format a number in an intelligent way.

Tree

Table Of Contents

Previous topic

XLSText

Next topic

SVN Revision 68881 For xlsgrid