Class 13 — Wednesday February 13
Nested looping, web, chrestomathics
An optimist thinks — Elevator close button — Really does something
A personal rule – When asked what's today's weather – The forecast is pain
Look both ways
For the fun of it
- Reveal one of your super power(s).
Best sellers
- How many of these books have you read?
CS 1112 CSV datasets
- Primary examples
Examples
- Program master_plan.py
- Displays the word of the day from the CS 1112 web file
word-of-the-day
???
- Program most_misspelled.py
- Displays on separate lines the lines making up the CS 1112 web file
most-misspelled
appreciate
beautiful
cancelled
definitely
desert
diarrhea
gray
leprechaun
maintenance
neighbor
pneumonia
vacuum
- Displays the contents of user-indicated web page
- Three possible program runs
Enter url: http://www.cs.virginia.edu/~cs1112/datasets/words/hangman
abated
abhors
ablush
abrade
...
zenith
zephyr
zipper
zombie
Enter url: http://www.cs.virginia.edu/~cs1112
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>CS 1112: Spring 2019
<link rel="shortcut icon" href="/~cs1112/images/favicon.ico" />
<body class="single-column-page"> ...
Enter url: http://forecast.weather.gov/zipcity.php?inputstring=22903
<!DOCTYPE html> <html class="no-js"> <head> <!-- Meta -->
<meta name="viewport" content="width=device-width">
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" /><title>National Weather Service</title> ...
<div class="row row-odd row-forecast"><div class="col-sm-2 forecast-label"><b>Today</b></div><div class="col-sm-10 forecast-text">Sunny, with a high near 48. West wind 10 to 17 mph, with gusts as high as 29 mph. </div> ...
</body> </html>
-
Program secret_revealed.py
- Determines the superpower associated with a user-suppled computing id.
- Two possible program runs
Enter computing id: mst3k
Thanato-etos cognition
Enter computing id: jpc
Thermal obtusion
-
Program get_a_dataset.py
- Get a user-specified web csv resource as a Python dataset
To do list
- Review class artifacts.
- Do chatter.py homework.
- Do digit_box.py homework.
- Do tail.py homework.