What are some approaches to outputting a Python data structure to reStructuredText

后端 未结 6 531
星月不相逢
星月不相逢 2020-12-31 18:21

I have a list of tuples in Python that I would like to output to a table in reStructuredText.

The docutils library has great support for converting reStructuredText

6条回答
  •  迷失自我
    2020-12-31 19:08

    Check out the tabulate package. It can output RST format by:

    print tabulate(table, headers, tablefmt="rst")
    

提交回复
热议问题