[Tutor] Programming Ideas, need some focus

bob gailer bgailer at alum.rpi.edu
Wed Jan 16 18:46:52 CET 2008

Yet one more offering: en.wikipedia.org/wiki/Python_Pipelines

This is my project - and a way you could help is:

I'd give you the specification of a "stage" and you'd develop a python 
function or class that would implement that stage. The first stages 
would be fairly simple, then things would get more involved.

I'd give you a testing framework in which to test a stage.

So the task would look like:

Specification of stage "foo": print the length of the input and if the 
length is less that 10 send the input to the output.

The simplest solution you could code is:

def run(input, output, spec=None):
    print len(input) # input is a character string of arbitrary length
    if len(input) < 10:
        output(input) # output is a function that sends its argument to 
"the output".

Then you'd test it thusly:

import pipetest
pipetest.test("Longer than 10")

Running the above should display:


Is that clear? Is that interesting? There are a lot of stages to be 
developed; many of them are much more complex, so this could provide for 
a step-by-step evolution of your skills.

Let me know one way or the other or ask clarifying questions.

Bob Gailer

More information about the Tutor mailing list