2

I have this code in the xml view:

<field name="fueled" sum="Sum of fueled"/>

How can I get value sum attribute to do some calculating in python file?

Naglis
  • 2,583
  • 1
  • 19
  • 24
Yahane
  • 21
  • 3

1 Answers1

0

Just do this:

from lxml import etree

etree.fromstring('<field name="fueled" sum="Sum of fueled"/>').xpath('//field/@sum')[0]