Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6136

Why doesn't tree.write create my XML file? [closed]

$
0
0

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?


Viewing all articles
Browse latest Browse all 6136

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>