Nick Craig-Wood wrote:
> ...
import signal, os, time
...
importing os is useless of course...
--
http://mail.python.org/mailman/listinfo/python-list
Nick Craig-Wood wrote:
superpollo wrote:
> ...
Or if you are on unix you can use signals...
It is probably just about acceptable to raise an exception in a signal
handler like this code does.
> ...
neat!
--
http://mail.python.org/mailman/listinfo/python-list
2009/7/16 superpollo :
> hello.
>
> based upon previuos suggestions, i tried to write a program in which i would
> like to have a certain code fragment to execute only for a specified amount
> of time (say 3 seconds), then bail out.
>
> but i get the following:
>
> $ cat tmr004.py
> #!/usr/bin/pyth
superpollo wrote:
> Diez B. Roggisch wrote:
> > superpollo wrote:
> >>am i wrong?
> >
> >
> > No, you are right, for threads that is. You can try & trick around with the
> > trace-functionality of python, and some ctypes-based
> > system-thread-module-tricks that are, as mentioned before, black
Diez B. Roggisch wrote:
superpollo wrote:
am i wrong?
No, you are right, for threads that is. You can try & trick around with the
trace-functionality of python, and some ctypes-based
system-thread-module-tricks that are, as mentioned before, black-magic & a
spinning gatling gun pointed to you
superpollo wrote:
> Diez B. Roggisch wrote:
>> superpollo wrote:
>>>see? the while body ran for about 7 seconds... i bet it has to do with
>>>the fact that the timer does not control inner loops... any suggestion?
>>
>>
>> Of course the inner loop isn't affected by the set event - how should it
Diez B. Roggisch wrote:
superpollo wrote:
see? the while body ran for about 7 seconds... i bet it has to do with
the fact that the timer does not control inner loops... any suggestion?
Of course the inner loop isn't affected by the set event - how should it be,
if you don't check it.
if you
Diez B. Roggisch wrote:
> superpollo wrote:
>
>> hello.
>>
>> based upon previuos suggestions, i tried to write a program in which i
>> would like to have a certain code fragment to execute only for a
>> specified amount of time (say 3 seconds), then bail out.
>>
>> but i get the following:
>>
Diez B. Roggisch wrote:
What you can't achieve in python without major black magic hackery that is
very dangerous is to terminate a thread while it is executing. Termination
has to be co-operative.
i see. thanks a lot.
bye
--
http://mail.python.org/mailman/listinfo/python-list
superpollo wrote:
> hello.
>
> based upon previuos suggestions, i tried to write a program in which i
> would like to have a certain code fragment to execute only for a
> specified amount of time (say 3 seconds), then bail out.
>
> but i get the following:
>
> $ cat tmr004.py
> #!/usr/bin/pytho
On Thu, Jul 16, 2009 at 6:34 PM, superpollo wrote:
> hello.
>
> based upon previuos suggestions, i tried to write a program in which i
> would like to have a certain code fragment to execute only for a specified
> amount of time (say 3 seconds), then bail out.
>
>
> see? the while body ran for
hello.
based upon previuos suggestions, i tried to write a program in which i
would like to have a certain code fragment to execute only for a
specified amount of time (say 3 seconds), then bail out.
but i get the following:
$ cat tmr004.py
#!/usr/bin/python -u
import threading , time
e =
12 matches
Mail list logo