skip to navigation
skip to content

pipe 1.3

Module enablig a sh like infix syntax (using pipes)

Latest Version: 1.4.2

Pipe is a module enablig a sh like infix syntax (using pipes)’.

As an exemple, here is the solution for the 2nd Euler Project exercise :

“Find the sum of all the even-valued terms in Fibonacci
which do not exceed four million.”

Given fib a generator of fibonacci numbers

euler2 = fib() | where(lambda x: x % 2 == 0)
               | take_while(lambda x: x < 4000000)
               | add
File Type Py Version Uploaded on Size
pipe-1.3.tar.gz (md5) Source 2011-03-29 6KB