What a great class we just had! Five kids ages 12–14, all of whom had studied some Python (programming language) with me before, met for five mornings for a class called Intermediate Python II. We learned a lot, and had our share of fun and silliness. During breaks, in my front yard, we threw water balloons or fired them with a slingshot, and played funny animal videos, like a sheep that screams like a human. Here are some of the things we learned.

Simple Webapps and Clients

Using two Python packages, Flask and Requests, we made webapps and client programs to access those webapps (in addition to using a web browser as a client). Some of the kids wrote joke servers—webapps that deliver a random joke when someone connects to, for example, http://192.168.1.128:8080/joke. With our client programs we fetched jokes from each other’s computers. Then we added loops to fetch jokes as fast as possible, learning about denial of service (DOS) attacks in the process, as well as countermeasures like delaying after each request, and blocking requests from specific users and returning messages like “Access denied!”. The kids really enjoyed this! (I made it very clear that DOS attacks were to be done only in isolated environments among willing participants, and not on the Internet.)

Networking Tools

We learned how to use tools like ping, netstat, ifconfig/ipconfig, traceroute/tracert, and telnet. We watched parts of a hilarious 1.5 million hits video by an enthusiastic but clueless young man who made the incredible claim that traceroute (tracert on Windows), which he called “tracer-tee”, could give you the IP addresses of everyone connected to Google right now. One of my students read the comments and saw one like, “If you represent the next generation of network attackers, the next generation of security experts can chill.”

Scatter Plot with matplotlib

There’s a package for Python called matplotlib that makes nice plots like this surface plot of heights and weights by age. We made ours with the kids’ actual data, and later I changed it to use the made-up data you see here. You can see the program if you like.

Stroop Test in Processing

Processing[.org] is a great tool for making animated art and graphics with a program. We did quite a bit with it, including making a Stroop Test. The Stroop Test presents words, like red, green, and blue, drawn in a different color from the color the word spells. Here’s an example: Red. You’re supposed to say “green” when you see that.

Plotting Current Weather

We learned to make web services requests from our Python programs to places like openweathermap.org, and then plot the results. 

Spelling Checker

We downloaded a file of over 50,000 correctly spelled words and wrote a program to read the file, load the words into a set, and use the set to identify misspelled words in text entered by the user.

Adventure Game in a Webapp

I gave the kids an example adventure game in a webapp, and they set to work adding their own places and pictures. I recommended that if they weren’t creating their own images, they go to search.creativecommons.org to find Creative Commons–licensed images. We ran out of time before we could add audio. One of the students wants to add a cliff to the game, and when the player falls off the cliff, the game plays the sheep scream. 
0

Add a comment

About Me
About Me
Popular Posts
Popular Posts
Blog Archive
Tags
Loading