A relatively simple package containing a class & methods for simulating dice. Can also simulate coin tosses, and Fudge dice as well.
Install/Uninstall with PIP
pip install https://github.com/Trebek/pyroller/archive/master.zip
pip uninstall pyroller
import pyroller
d6 = pyroller.Pyroller("d6")
result = d6.roll()
print result
Example output:
5
from pyroller import Pyroller
notations = ["d6", "3d6", "d20", "4dF", "coin"]
bag = Pyroller.build_bag(notations)
for key in bag:
roll_str = str(bag[key].roll())
print "%s = %s" % (key, roll_str)
Example output:
d6 = 4 d20 = 9 3d6 = [4, 2, 5] coin = Tails 4dF = [' ', ' ', '+', '-']