Help using the signal module, please?
Tim Peters
tim.one at home.com
Mon May 14 02:31:08 EDT 2001
[Sheila King]
> OK, I'm not sure why this isn't working. I've copied exactly from
> the example in the 2.0 documentation, here:
> http://www.python.org/doc/2.0/lib/Signal_Example.html
>
> At the top of my script I have:
>
> import signal
> ...
And let's skip to the clue:
> Traceback (most recent call last):
> File
> "E:\Python\Python20\Pythonwin\pywin\framework\scriptutils.py", line 301,
> in RunScript
> exec codeObject in __main__.__dict__
> File "E:\Python\Python20\testprograms\Boggle.py", line 64, in ?
> signal.signal(signal.SIGALRM, timesUp)
> AttributeError: SIGALRM
You're clearly running on Windows. Signals are a Unix thing, and Windows
supports only the bare minimum signal facilities required by the C standard
(which amounts to nothing useful). Even across Unix flavors, as the Python
docs say:
Note that not all systems define the same set of signal
names; only those names defined by the system are defined
by this module.
Sorry! If you want to play with signals, you'd better bring up Linux
instead.
More information about the Python-list
mailing list