Although I have no Python experience it seems to be well supported by the Yun, so I will try that road...
The mail body should be an xml document. For now, I will just try to parse a mail body that contains:
<yafadoc> <temp> 22.3 </temp> </yafadoc>
I will not worry about error handling, etc.... that is an important aspect, but for later.
I am going to use ElementTree for parsing. When I tried to build a tree from my body string as follows:
tree = ET.ElementTree(ET.fromstring(body))
I got the error:
ImportError: No module named expat; use SimpleXMLTreeBuilder instead
I solved this by:
opkg update opkg install python-expat
No comments:
Post a Comment