Python代码实现单个文件夹下多个html文件转md文件
Python代码实现单个文件夹下多个html文件转md文件 废话不多说,直接上代码 import os # 如果没有此模块,在终端 pip install html2text mport html2text as ht text_maker = ht.HTML2Text() # 文件夹路径 path="C:/Users/ttzxh\Desktop/PBI/02_Excel" # 遍历文件夹 for file in os.listdir(path): # 抛异常,没有bug就执行try的部分,否侧执行except的部分 try: # 判断file是否是文件夹,不是就执行
下载地址
用户评论