I want to read from a specified file in a source code (.map file) and to write the variables from there that have a certain name to an excel workbook. Some hints?
Asked
Active
Viewed 1,657 times
4 Answers
0
I'm not sure you can directly write to an excel workbook, but you can easily create a CSV
file and then import it to your excel workbook.

mavili
- 3,385
- 4
- 30
- 46
-
[Similar question](http://stackoverflow.com/questions/5705588/python-creating-excel-workbook-and-dumping-csv-files-as-worksheets) – 4d4c Aug 08 '13 at 09:20
0
Actually there are modules available for Python to help with this. The easy way would be to just write to a .CSV file and then the user can open in Excel as suggested by others. However, if you want to write to a real Excel file check out the modules here.
I have used xlrd to read Excel files before and it's not too difficult to get started with. I haven't yet tried writing to an Excel file with xlwt, but it sounds like this should do what you need. I have found some examples here.

ChrisProsser
- 12,598
- 6
- 35
- 44
0
You have several possibilities here:
- Create a comma separated value, (csv), or tab separated value file, and read it into excel.
- Use the tools at python-excel to write an excel file directly,
- Write excel compatible XML files in many ways.
- Use win32com to open and control excel on the same machine to do the job, examples.

Steve Barnes
- 27,618
- 6
- 63
- 73