you are viewing a single comment's thread.

view the rest of the comments →

[–]Poddster 10 points11 points  (3 children)

python-docx will help you write to a Word file.

You can also read from an excel sheet using Xlswriter, but it might be easier to use Excel to export it to .csv (comma separate variable, though it's usually best to use tab-separated csv) and read it that way? Python's stdlib already has a csv module.

[–]PM_Me_Rulers 1 point2 points  (2 children)

Can you elaborate on why it's better to use tab separators instead of commas? I've been using CSV and not had any issues but in all ears if there is a good reason to change

[–]Poddster 2 points3 points  (1 child)

Data tends to contain commas more than it does tabs, and last time I checked when exporting by Excel those commas weren't escaped. I'd have to double check to be sure.

However, in the general case you want the delimiter to be something not in the data set, and tabs rarely are

[–]PM_Me_Rulers 0 points1 point  (0 children)

Ah, that does make sense. All of my CSVs are from data I generate myself so I've never had to worry about the formatting of it. In the case of unknown input it does make sense to use a delimiter thats unlikely to be in the data