[Tutor] Printing time without "if" statement
Steve Willoughby
steve at alchemy.com
Mon Mar 8 06:53:26 CET 2010
On Sun, Mar 07, 2010 at 11:38:49PM -0500, Elisha Rosensweig wrote:
> Hi,
>
> I have an event-based simulator written in Python (of course). It takes a
> while to run, and I want to have messages printed every so often to the
> screen, indicating the simulation time that has passed. Currently, every
> event that occurs follows the following code snippet:
It depends on how your system simulates the events and their
scheduling, but you might look at the sched module in the standard
library. Maybe you would be able to use that to schedule your
simulated events and also schedule periodic time output too.
--
Steve Willoughby | Using billion-dollar satellites
steve at alchemy.com | to hunt for Tupperware.
More information about the Tutor
mailing list