txt文件转为word
复制代码
1
2
3
4
5
6
7
8
9def get_file(file_dir): for root, dirs, files in os.walk(file_dir): return files # 返回所有文件名的列表 info_list = get_file("info_500") #txt文件名 for i in info_list: new = i.replace("txt", "docx") os.rename("info_500/%s"%i, "info_500/%s"%new)
最后
以上就是粗心早晨最近收集整理的关于python实现txt文件转为word的全部内容,更多相关python实现txt文件转为word内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复