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:
# initilize
printstep = 10
nextprint = 10
# for each event
if current_time > nextprint:
print 'time past: ' + str(nextprint)
nextprint += printstep
This seems stupid to me - why should I have to check each round if the time
has been passed? I was thinking that there might be a simpler way, using
threading, but I have zero experience with threading, so need your help. The
idea was to have a simple thread that waited X time (CPU cycles, say) and
then read the "current_time" variable and printed it.
Any simple (simpler?) solutions to this?
Thanks
Elisha
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor