Popular recipes by Symon Polley http://code.activestate.com/recipes/users/4056524/popular/2007-10-19T22:33:18-07:00ActiveState Code RecipesFunction Timeout (Python)
2007-10-19T22:33:18-07:00Symon Polleyhttp://code.activestate.com/recipes/users/4056524/http://code.activestate.com/recipes/534115-function-timeout/
<p style="color: grey">
Python
recipe 534115
by <a href="/recipes/users/4056524/">Symon Polley</a>
(<a href="/recipes/tags/algorithms/">algorithms</a>).
Revision 2.
</p>
<p>a simple and useful script that uses signal to time out any function.</p>
<p>EDIT: use Jim Carrolls solution below</p>
Dice Roll (Python)
2007-07-11T00:28:09-07:00Symon Polleyhttp://code.activestate.com/recipes/users/4056524/http://code.activestate.com/recipes/522978-dice-roll/
<p style="color: grey">
Python
recipe 522978
by <a href="/recipes/users/4056524/">Symon Polley</a>
(<a href="/recipes/tags/oop/">oop</a>).
Revision 5.
</p>
<p>An object oriented approach to rolling a custom dice!
this technique allows a person to define a custom dice by list,
by integer, or by nothing at all defaulting to 6 sides.</p>
VectorObject (Python)
2007-05-18T06:16:01-07:00Symon Polleyhttp://code.activestate.com/recipes/users/4056524/http://code.activestate.com/recipes/520585-vectorobject/
<p style="color: grey">
Python
recipe 520585
by <a href="/recipes/users/4056524/">Symon Polley</a>
(<a href="/recipes/tags/oop/">oop</a>).
</p>
<p>A class used for creating any object moving in 2D or a Vector Object
it takes the initial position, speed, and direction, and lets you
addspeed to the the object, steer the object and update it by time.</p>