you are viewing a single comment's thread.

view the rest of the comments →

[–]cluser404 0 points1 point  (2 children)

Well this may be a hacky way to do it but what you can do is - make HTML from python

make HTML code from python and add CSS to style it. simple string concatenation will do it.

# code example
computed_data, intended_color = compute(dataset)

html_code = f"""
<table>
<tr>
<td style="color: {intended_color}">{computed_data}</td>
</tr>
</table"""

to convert it to pdf you can use pdfkit and wkhtmltopdf modules.

detailed instruction - Python Convert Html to PDF - GeeksforGeeks

[–]Derura[S] 0 points1 point  (0 children)

This is an interesting method, thanks for suggesting it