Using PyCharm on Kubuntu Linux I modify an XML file by adding an entry and write the changes to a new file, but the file doesn't get created and no error is displayed:
import xml.etree.ElementTree as ETif __name__ == ('__main__:'): tree = ET.parse('/home/qual/PycharmProjects/Automation_learn/ip_phone_cfg.xml') root = tree.getroot() child = ET.Element('ELEMENT_NAME') child.text = '192.168.10.12' root.append(child) tree.write('/home/qual/PycharmProjects/Automation_learn/ip_phone_cfg2.xml')
What is the problem? Do I need additional rights for the folder where I create the file?