• 2024-06-19python模块之codecs
    python模块codecspython对多国语言的处理是支持的很好的,它可以处理现在任意编码的字符,这里深入的研究一下python对多种不同语言的处理。有一点需要清楚的是,当python要做编码转换的时候,会借助于内部的编码,转换过程是这样的:原有编码->内部编码->目的编码python的内部
  • 2024-05-16把markdown文件转换为html文件
    使用pipinstallmarkdown模块只做到了分行;表格,-,和空格还没能无缝转换代码如下:importosimportcodecsimportmarkdowndefconvert_markdown_to_html(markdown_file):withcodecs.open(markdown_file,'r',encoding='utf-8')asfile:markdown_text=fil