Monday, 12 August 2013

launching Excel application using Python to view the CSV file , but CSV file is opening in read mode and cant view the data written on it

launching Excel application using Python to view the CSV file , but CSV
file is opening in read mode and cant view the data written on it

from win32com.client import Dispatch
base_path = os.path.dirname(os.path.abspath(__file__))
_csvFilename = os.path.join(base_path, "bcForecasting.csv")
_csvFile = open (_csvFilename, 'wb')
_csvFile = csv.writer(_csvFile, quoting=csv.QUOTE_ALL)
_Header = ['Name']+self.makeIntoList (self.root.tss.series ()
[0].getAllTimes (), self.originalTimesteps + _futurePeriods)
_csvFile.writerow (_Header)
xl = Dispatch('Excel.Application')
wb = xl.Workbooks.Open(_csvFilename)
xl.Visible = True
Here launching Excel application using Python to view the CSV file , but
CSV file is opening in read mode and cant view the data written on it.
Please help.

No comments:

Post a Comment