Mar-09-2022, 12:26 AM
Hi all,
I'm new to Python. I have this :
I'm new to Python. I have this :
>>> import xml.etree.ElementTree as ET >>> xml_to_parse1 = ET.parse('/tmp/xmlfile.xml') >>> get_xml = xml_to_parse1.getroot() >>> for x in get_xml.findall('physicaldisk'): ... diskType =x.find('diskType').text ... print(diskType) ... HardDisk HardDisk HardDisk HardDisk HardDisk HardDisk HardDisk HardDisk HardDisk HardDisk HardDisk HardDisk FlashDisk FlashDisk FlashDisk FlashDisk FlashDisk FlashDisk FlashDisk FlashDisk M2Disk M2Disk PMEM PMEM PMEM PMEM PMEM PMEM PMEM PMEM PMEM PMEM PMEM PMEM >>>I want add all these values (remove duplicate) to a LIST. How to do that in python?