labjack / LabJackPython

The official Python modules and classes for interacting with the LabJack U3, U6, UE9 and U12
https://labjack.com/support/software/examples/ud/labjackpython
MIT License
117 stars 79 forks source link

SIGALRM in outputSinDac.py not found #98

Closed vogt31337 closed 7 years ago

vogt31337 commented 7 years ago

outputSinDac.py, line 87 in signal.signal(signal.SIGALRM, dacs.handleSetDac) AttributeError: 'module' object has no attribute 'SIGALRM'

Windows 7 Python 2.7.13 installed via pip install.

davelopez01 commented 7 years ago

Thanks for mentioning this. Currently this example is only Linux and Mac compatible. I haven't gotten around to updating it for Windows yet, but I'll look into it soon.

mnaberez commented 7 years ago

We should probably add something like this until it's updated:

import os
assert os.name == "posix", "This example makes Unix-specific assumptions"

That error will be clearer to Windows users than the AttributeError they currently get.

davelopez01 commented 7 years ago

@mnaberez , thanks. If I can't get to updating this example for cross-platform support by Friday (06/23), I'll probably add your assert code for the meantime.

davelopez01 commented 7 years ago

Resolved in latest commit. The new outputSinDac works on Windows, Linux and Mac. The old, Unix only example is now called outputSinDacUnix.