Brad

Courage

God has been speaking to me lately about how the approval and disapproval of others means to me.

In short, I think I hear God saying, “Yes, I want you to learn to live in harmony with others. Yes, it feels good when people appreciate what you’re doing. Yes it’s nice when people urge you on.

“But I need servants that aren’t addicted to approval. I need disciples that aren’t easily manipulated by opinion. I need you to be part of community, but strong enough to act—and keep acting—by faith.

“I can teach you those things…but only by sending times that test your resolve and break you

10: Paratext API Basics

From the Reading

(No reading yet.)

From the Session

You Should be Able To

  1. Discover Paratext Parameters
  2. Edit a CMS file
  1. Initialize ScriptureObjects

09: Review & Extras

From the Reading

From the Session

  1. True, False, Integer, Real
  2. globals() and locals()
  1. Data-flow diagrams help when there are multiple inputs, outputs, and transformations

You Should be Able To

08: Function Power

This session we introduce a very useful concept: Python functions are objects too.

The fancy name for this is Functional Programming.

The idea is advanced, but using it comes easily. And once you start to think this way, it opens up new ways to solve old problems.

Before the Session

  • Do your exercises from last time and send them to the insructor.
  • Read the Functional Python page on this site. You may want to use the printer-friendly link on that page.
  • If you find that reading fairly easy, deepen your understanding by reading some of the following resources in this order.

Input-Process-Output

(Look at the bottom of this page for printer-friendly output.)

Simple IPO

Familiar To You

Input-Process-Output, or IPO, is a simple method for designing computer programs.

You probably use it already whenever you sit at the computer.

You probably ask yourself:

  1. What do I have to start with? {color:navy} Your Input!
  2. What steps do I need to do? {color:navy} Your Process!
  1. What do I want to produce? {color:navy} Your Output!

Pen And Paper Tools

Most people begin an IPO project with a sheet of paper.

First, draw and label the three columns:

Input Process Output
     
     
     

Next, we’ll begin to fill the columns in…

Fresh Starts

Okay, here we are. Three blank columns staring at us. How do we start?

First we need our problem description. Let’s say you, your boss, or someone you’re trying to help, has a word processing document they want converted to USFM(A text markup derived from Ventura Publisher and used in many Bible Publishing Projects).

That’s are raw input, but we can’t read it raw. We think for a minute, then decide to export it to HTML.

When I use IPO, I fill in whatever I can. Usually I like to do the Output column first. I think more clearly then. But sometimes I start with inputs. Usually I go back and forth between the two.

07: Design

Somebody can demonstrate the tools for building a house. You can learn to hammer nails, cut lumber, thatch a roof, buy a hinge.

You can know all that and still not know how to build a house.

Same thing happens with programming. If we teach you the parts without teaching design, you will know a lot. But you won’t know how to use it.

This session, we’ll learn about design method called Input-Process-Output. It’s decades old. It’s simple. But it works for many of the things we do with Python. It will give you a handle on how to solve a new problem.

Before The Session

  1. Read the I-P-O page on this site.

06: RegEx

Before The Session

  1. Read: Dive Into Python Chapter 7.
  1. Do the exercises from previous session.

During The Session

  1. Nathan’s Regex Building Technique
  2. Match objects: m.groups(), m.group()
  3. When searching becomes too complex (stateful) for regexes, chunk or parse.
  4. m.group(0) is complete match, m.group(1) is first capture
  5. Pattern:
    1. read old file,
    2. create new name,
    3. transform data,
  1. write new file

After The Session

  1. Review learning goals for this and the previous sessions.

05: Files & Exceptions

Before The Session

  1. Read: Dive Into Python Chapter 6.
  1. Do the exercises from previous session.

During The Session

  1. Think of exceptions as errors at first.
  2. (Really they are exceptional conditions, out-of-the-ordinary happenings. No more items in a list.)
  1. iterating a file object gets its lines

After The Session

  1. Review learning goals for this and the previous sessions.
  2. Download PyTrainExercises.zip.
  3. Open exercise05.py
  1. Read the comments. Do what they instruct.

D: "Diving In" Goals

Book OUtline

Learning Goals Order in Dive Into Python

These are Brad’s notes from Dive Into Python, here to assist lesson planning and keeping readings in line with what’s actually covered.

Chapter 1: Installing Python

We don’t cover this in the course.

Chapter 2: Your First Python Program

  1. You can define new functions with def.
  2. Every function returns a value. (Default is None.)
  3. Python is dynamically typed. Variables are typed by the values they hold. Assignment can change a variable’s type.
  1. Python is strongly typed. Strings don’t get automatically converted to numbers, etc.

Dis-Courage-Ment


Leaking the courage God already gave you.

See also: Where you’re at when…

  • You disappoint yourself
  • You dream of quitting
  • You quit dreaming
  • You forgot God’s faithfulness. Again.

So many bad reasons for doing good work, but each one a way for faith to grow…

Syndicate content