将Markdown转换为HTML 发表于 2017-08-01 | 分类于 python 安装markdown库:pip intsall markdown 核心代码: 123456from markdown import markdowntxt_md = "# a"txt_html = markdown(txt_md)print txt_md, txt_html # # a, <h1>a</h1>