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
Question: 
    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.


Answer: You need to _close_ the `csv` file before you open it with Excel:

    
    
    with open (_csvFilename, 'wb') as _csvFile
        _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 
    

By using a `with` statement the open file object is automatically closed when
the block indented under the statement completes.

Windows doesn't like it when more than one application has a file open.

