I am converting a java project into python but dont really know much about pyhton This is what i am doing in java:
document dom;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
try {
DocumentBuilder db = dbf.newDocumentBuilder();
dom = db.parse(xml);
Element doc = dom.getDocumentElement();
NodeList test_info = doc.getElementsByTagName("test_info");
NodeList attributes = test_info.item(0).getChildNodes();
BufferedWriter writer = null;
writer = new BufferedWriter(new FileWriter(csv));
How to convert this to python?