Outline for November 3, 2025

Reading: §12.1–12.5, 13.1–13.5
Assignments: Homework 3, due November 12, 2025

  1. perm done recursively

  2. Reading a URL [geturl.py, geturl2.py, geturl3.py]
    1. Opening a URL
    2. Reading the page as a string
    3. The role of decode() [geturl-nd.py]
    4. SSL/TLS and python [geturl-ssl.py]

  3. A program to print links in web pages [urlpat.py, urlpat2.py]

  4. JSON [json-ex.py]
    1. What it is
    2. json.loads
    3. json.dumps

  5. What is XML?
    1. Tree structure
    2. Elements, tags, attributes, attribute values
    3. Example: sample1.xml

  6. Python and XML [basic-xml.py]
    1. xml.etree.ElementTree
    2. Parsing the tree from file input (ET.parse()), from a string (ET.fromstring())
    3. Referring to elements
    4. Accessing tag names, attributes
    5. Finding nodes in the tree
    6. Dumping, writing the tree
    7. Removing an element and its descendants
    8. Changing an element’s attribute
    9. Setting attributes

  7. Prettyprinting XML [xmlpp.py, xmlpp-full.py]

UC Davis sigil
Matt Bishop
Office: 2209 Watershed Sciences
Phone: +1 (530) 752-8060
Email: mabishop@ucdavis.edu
MHI 289I, Programming in Health Informatics
Version of November 2, 2025 at 11:12AM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh