Last updated:
0 purchases
randy 0.9.3
A pure-python random number generator expander.
Given a random number generator that yields numbers in the range 1-n,
create a new random number generator that yields numbers in the range
1-y where y>x, x>1, y>1, y>x**2
How do I get set up?
python setup.py install
Dependencies: six
Dependencies (test): Coverage, nose
How to run tests: ./runtests.sh
Deployment instructions: pip install shifty
Contribution guidelines
I accept pull requests.
What about test coverage?
There is a full suite of unit-tests.
Who do I talk to?
Francis Horsman: [email protected]
Example
>>> from randy import randy
>>> import random
>>> r = randy(5, 7, fn=lambda: random.randint(1, 5))
Slice it:
>>> random_value = r[2] 3
Call it:
>>> random_value = r() 1
Iterate with it:
>>> random_value = iter(r).next() 5
Print it:
>>> str(r) 'randy(7 from 5): [[1, 2, 3, 4, 5], [6, 7, 1, 2,3], [4, 5, 6, 7, 1], [2, 3, 4, 5, 6], [7, 0, 0, 0, 0]]'
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.