Import data from Excel

Dale Strickland-Clark dale at riverhall.nospam.co.uk
Tue May 9 09:23:13 CEST 2006


Try this:

from win32com.client import GetObject, constants

def GetExcelData(self, strFilePath):
    """ Extract the data from the Excel sheet. 
    Returns tuple of tuples representing the rows and cells."""
    # The following line extracts 
    # all the data from sheet 1 of the spreadsheet
    return GetObject(strFilePath).Sheets(1).UsedRange.Value


N/A wrote:

> Hi,
> Is it possible to import data from Excel for doing numerical analysis in
> Python? If so how? Thank u!

-- 
Dale Strickland-Clark
Riverhall Systems - www.riverhall.co.uk




More information about the Python-list mailing list