how to convert dict to html in Python

PHOTO EMBED

Wed Jun 19 2024 08:47:26 GMT+0000 (Coordinated Universal Time)

Saved by @freepythoncode ##python #coding #python #programming #html

import pandas as pd

dict_data = {
    'users': ['user_123', 'user_abc'],
    'tasks': ['test1', 'test2']
}

df = pd.DataFrame.from_dict(dict_data)
df.to_html('out.html')
content_copyCOPY