Using OS time

valhalla tireseas at onetel.com
Fri Jun 20 11:45:16 EDT 2003


Hello

I asked this query of the Tutor list and was told that Python probably didn't 
have a solution, and that I should use the OS. I want to cast my question net 
a little further, hence my asking this question here.

The problem:
I am writing a rather simple guessing game (a random number is generated, user 
has to guess the number).
I am wanting to introduce a time-limit on the game-play so that the user has - 
e.g. 60 seconds - within which to guess the correct number otherwise they 
lose.

The question:
I was hoping to use something out of the time module but could find no 
function to do that kind of thing. I was pointed in the direction of 
importing my OS (Linux) time. 
1. Would this accomplish what I am wanting to as described above?
2. If so, can someone point me in the direction of some decent docs on how I 
could set this up.

I am positive that there must be a relatively straight forward solution, but 
right now I can't see the wood for the trees and would appreciate a different 
perspective please.

Cheers
Andy



-- 
====================
||  Reg. Linux User: 313143 ||
====================
Sign the Petition:
http://www.PetitionOnline.com/endtcpa1/





More information about the Python-list mailing list