Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/XML-Output/Python/xml-output-1.py
Normal file
14
Task/XML-Output/Python/xml-output-1.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
>>> from xml.etree import ElementTree as ET
|
||||
>>> from itertools import izip
|
||||
>>> def characterstoxml(names, remarks):
|
||||
root = ET.Element("CharacterRemarks")
|
||||
for name, remark in izip(names, remarks):
|
||||
c = ET.SubElement(root, "Character", {'name': name})
|
||||
c.text = remark
|
||||
return ET.tostring(root)
|
||||
|
||||
>>> print characterstoxml(
|
||||
names = ["April", "Tam O'Shanter", "Emily"],
|
||||
remarks = [ "Bubbly: I'm > Tam and <= Emily",
|
||||
'Burns: "When chapman billies leave the street ..."',
|
||||
'Short & shrift' ] ).replace('><','>\n<')
|
||||
5
Task/XML-Output/Python/xml-output-2.py
Normal file
5
Task/XML-Output/Python/xml-output-2.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<CharacterRemarks>
|
||||
<Character name="April">Bubbly: I'm > Tam and <= Emily</Character>
|
||||
<Character name="Tam O'Shanter">Burns: "When chapman billies leave the street ..."</Character>
|
||||
<Character name="Emily">Short & shrift</Character>
|
||||
</CharacterRemarks>
|
||||
Loading…
Add table
Add a link
Reference in a new issue