Python 正确打印xml标记

Python 正确打印xml标记,python,Python,但是当我打印时,我得到的输出如下所示。我如何从输出中删除{} tree = ElementTree(file= filename) root = tree.getroot() for Group in root: for Project in Group: for child in Project: print child.tag,child.text 按}拆分名称,并取最后一部分 {http://schemas.microsoft.com/developer/buil

但是当我打印时,我得到的输出如下所示。我如何从输出中删除{}

tree = ElementTree(file= filename)
root = tree.getroot()
for Group in root:
for Project in Group:
    for child in Project:
        print child.tag,child.text

}
拆分名称,并取最后一部分

{http://schemas.microsoft.com/developer/build/2003}Node1 true
{http://schemas.microsoft.com/developer/build/2003}Node2 false
{http://schemas.microsoft.com/developer/build/2003}Node3 D3A4E4D9-C9E4-4f31-A225-   E10A48AA5E10
{http://schemas.microsoft.com/developer/build/2003}Node4 D3A4E4D9C9E44f31A225E10A48AA5E10
{http://schemas.microsoft.com/developer/build/2003}Node5 C6311C26-274C-40ea-8DF8-34F80F00DED3
{http://schemas.microsoft.com/developer/build/2003}Node6 C6311C26-274C-40ea-8DF8-34F80F00DED
{http://schemas.microsoft.com/developer/build/2003}Node7 128
{http://schemas.microsoft.com/developer/build/2003}Node8 128
{http://schemas.microsoft.com/developer/build/2003}Node9 1000
{http://schemas.microsoft.com/developer/build/2003}Node10 255
{http://schemas.microsoft.com/developer/build/2003}Node11 0
{http://schemas.microsoft.com/developer/build/2003}Node12 128
{http://schemas.microsoft.com/developer/build/2003}Node13 007
输出:

tree = ElementTree(file=filename)
root = tree.getroot()
for Group in root:
    for Project in Group:
        for child in Project:
            print child.tag.split('}')[-1], child.text
tree = ElementTree(file=filename)
root = tree.getroot()
for Group in root:
    for Project in Group:
        for child in Project:
            print child.tag.split('}')[-1], child.text
Node1 true
Node2 true
Node3 false
Node4 D3A4E4D9-C9E4-4f31-A225-E10A48AA5E10
Node5 D3A4E4D9-C9E4-4f31-A225-E10A48AA5E10
Node6 C6311C26-274C-40ea-8DF8-34F80F00DED3
Node7 C6311C26-274C-40ea-8DF8-34F80F00DED3
Node8 128
Node9 128
Node10 1000
Node11 255
Node12 0
Node13 128
Node14 007