代码:
1 import os 2 if __name__ =="__main__": 3 Whole_path = r"E:Tomcatwebapps基于合同纠纷知识图谱构建及应用\upload原告.doc" 4 Whole_path=fl.File_doc2docx(Whole_path) 5 print(os.path.splitext(Whole_path)) 6 # 结果 ('E:\Tomcat\webapps\基于合同纠纷知识图谱构建及应用\\upload\原告', '.doc') 7 print(os.path.split(Whole_path)) 8 # 结果 ('E:\Tomcat\webapps\基于合同纠纷知识图谱构建及应用\\upload', '原告.doc')