使用
os.path.join()。范例:
os.path.join(pathfile,"output","log.txt")。
在您的代码中将是:
rootTree.write(os.path.join(pathfile,"output","log.txt"))

使用
os.path.join()。范例:
os.path.join(pathfile,"output","log.txt")。
在您的代码中将是:
rootTree.write(os.path.join(pathfile,"output","log.txt"))