Changes

From Gramps

Libhtml

No change in size, 18:14, 1 April 2009
Examples
==== Examples ====
#*Retrieve the tag name of an Html object:
>>> html = Html('html')
>>> html
>>>
#*Change the tag name:
>>> html.tag = 'tail'
>>> html
>>>
#*Retrieve the tag attributes:
>>> a = Html('a', href='http://cnn.org')
>>> a
>>>
#*Change the tag attributes:
>>> a.attr
'href="http://gramps-project.org"'
>>>
#*Extend the tag attributes:
>>> a.attr += ' id="myhref"'
>>> a.attr
>>>
#*Delete the tag attributes:
>>> del a.attr
>>> a.attr
>>>
#*Retrieve whatever is inside a tag:
>>> p = Html('p','This is a paragraph')
>>> p.inside
>>>
#*Change whatever is inside a tag:
>>> p.inside = "This is a better paragraph"
>>> p.inside
>>>
#*Extend whatever is inside a tag:
>>> p.inside += ["THIS IS THE BEST PARAGRAPH!"]
>>> p.inside
>>>
#*Delete whatever is inside a tag:
>>> del p.inside
>>> p.inside
[]
>>> p
70
edits

Navigation menu