Skip to content
Snippets Groups Projects
Commit 50358fa8 authored by Matthias Diener's avatar Matthias Diener
Browse files

Table: add csv output

parent 78bd77cb
No related branches found
No related tags found
No related merge requests found
......@@ -1561,6 +1561,18 @@ class Table:
return "\n".join(lines)
def csv(self):
"""Returns a string containing a CSV representation of the table."""
import csv
import io
output = io.StringIO()
writer = csv.writer(output)
writer.writerows(self.rows)
return output.getvalue().rstrip('\n')
def latex(self, skip_lines=0, hline_after=None):
if hline_after is None:
hline_after = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment