Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Repeatedly call func(*args) and yield the result.

Useful when func(*args) returns different results, esp. randomly.

        def repeatcall(func, *args):
	"""Repeatedly call func(*args) and yield the result.
	
	Useful when func(*args) returns different results, esp. randomly.
	"""
	return itertools.starmap(func, itertools.repeat(args))
        


src/s/t/stream.py-HEAD/example/randwalk.py   stream.py(Download)
 
from random import choice
from stream import repeatcall, apply, fold, takei, takewhile, drop, item
 
 
Directions = [[1,0], [0,1], [-1,0], [0,-1]]
 
randwalk = lambda: repeatcall(choice, Directions) >> fold(vectoradd, initval=Origin)
 
def returned(n):

src/s/t/stream-0.8/example/randwalk.py   stream(Download)
 
from random import choice
from stream import repeatcall, apply, fold, takei, takewhile, drop, item
 
 
Directions = [[1,0], [0,1], [-1,0], [0,-1]]
 
randwalk = lambda: repeatcall(choice, Directions) >> fold(vectoradd, initval=Origin)
 
def returned(n):