horse
horse

Reputation: 31

XML - python prints extra lines

from xml import xpath
from xml.dom import minidom


xmldata = minidom.parse('model.xml').documentElement

for maks in xpath.Evaluate('/cacti/results/maks/text()', xmldata):
    print maks.nodeValue

And I get result:

85603399.14

398673062.66

95785523.81

But I needed to be:

85603399.14

NO SPACE

398673062.66

NO SPACE

95785523.81

Can somebody help me? I am new at programming

Upvotes: 1

Views: 255

Answers (1)

Krishna K
Krishna K

Reputation: 1975

Use:

print maks.nodeValue,

The comma at the end doesn't insert the extra newline.

Upvotes: 3

Related Questions