home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.2)
-
-
- class myExcel:
-
- def __init__(self, filename = None):
- Dispatch = Dispatch
- import win32com.client
- self.xlApp = Dispatch('Excel.Application')
- if filename:
- self.filename = filename
- self.xlBook = self.xlApp.Workbooks.Open(filename)
- else:
- self.xlBook = self.xlApp.Workbooks.Add()
- self.filename = ''
-
-
- def save(self, newfilename = None):
- if newfilename:
- self.filename = newfilename
- self.xlBook.SaveAs(newfilename)
- else:
- self.xlBook.Save()
-
-
- def close(self):
- self.xlBook.Close(SaveChanges = 0)
- del self.xlApp
-
-
- def getCell(self, sheet, row, col):
- sht = self.xlBook.Worksheets(sheet)
- return sht.Cells(row, col).Value
-
-
- def setCell(self, sheet, row, col, value):
- sht = self.xlBook.Worksheets(sheet)
- sht.Cells(row, col).Value = value
-
-
- def fixStringsAndDates(self, aMatrix):
- newmatrix = []
- for row in aMatrix:
- newrow = []
- for cell in row:
- if type(cell) is UnicodeType:
- newrow.append(str(cell))
- elif type(cell) is TimeType:
- newrow.append(int(cell))
-
-
- newmatrix.append(tuple(newrow))
-
- return newmatrix
-
-
-