Running a python script for a user-specified amount of time?
<p>Sorry, this is probably a terrible question. I've <strong>JUST</strong> started learning python today. I've been reading a Byte of Python. Right now I have a project for Python that involves time. I can't find anything relating to time in Byte of Python, so I'll ask you:</p>

<p>How can I run a block for a user specified amount of time and then break?</p>

<p>For example (in some pseudo-code):</p>

<pre><code>time = int(raw_input('Enter the amount of seconds you want to run this: '))
while there is still time left:
    #run this block
</code></pre>

<p>or even better:</p>

<pre><code>import sys
time = sys.argv[1]
while there is still time left:
    #run this block
</code></pre>

<p>Thanks for any help. Also, additional online guides and tutorials would be much appreciated. I really like Byte of Python. Dive into Python can't quite hold my attention, though. I suppose I should suck it up and try harder to read that one.</p>
