我是靠谱客的博主 粗心早晨,这篇文章主要介绍python实现txt文件转为word,现在分享给大家,希望可以做个参考。

txt文件转为word

复制代码
1
2
3
4
5
6
7
8
9
def 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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(75)

评论列表共有 0 条评论

立即
投稿
返回
顶部