sleep?

Simon Foster simon at uggs.demon.co.uk
Thu Jan 24 19:29:29 EST 2002


On Thu, 24 Jan 2002 03:51:24 -0600, montanaro at tttech.com wrote:

>
>    Max> could it be taht this isn't possible in win?
>
>Dunno.  You can test the signal.alarm call from the interpreter prompt:
>
>    >>> import signal
>    >>> signal.alarm(1)
>    0
>
>After 1 second I get:
>
>    >>> Alarm clock
>
>and Python exits (because I had no handler set up for SIGALRM).
>
>I think asyncore works on Windows, so my alarms module should work, though I
>only wrote it a few days ago and it hasn't been tried on Windows yet.
>
>Skip


No, there is no 'alarm' method on Windows


Python 2.2c1 (#27, Dec 14 2001, 13:15:16) [MSC 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import signal
>>> signal.alarm(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: 'module' object has no attribute 'alarm'
>>> dir( signal )
['NSIG', 'SIGABRT', 'SIGBREAK', 'SIGFPE', 'SIGILL', 'SIGINT',
'SIGSEGV', 'SIGTER
M', 'SIG_DFL', 'SIG_IGN', '__doc__', '__name__',
'default_int_handler', 'getsign
al', 'signal']
>>>
--
Simon Foster
Cheltenham
England



More information about the Python-list mailing list