I have a device which outputs several values that normally look like the following:
-1.6410,0.5390,0.5570
-1.6160,0.3860,0.5620
-1.4890,-0.0760,0.5260
-1.4120,-0.1740,0.5290
-1.2920,-0.2160,0.6110
-1.2520,-0.2510,0.6450
-1.2530,-0.2270,0.6330
-1.2670,-0.2220,0.6530
-1.2350,-0.2250,0.7170
-1.4470,-0.3840,0.2400
-1.2670,-0.7480,0.0630
-1.0690,-0.9340,-0.1400
-0.9440,-1.0000,-0.2440
The three numbers may be of any length, and may be positive or negative. Is there a way (in Python) to check that valid numbers were returned rather than a text string (like "CHECKSUM ERROR" or the like)? I don't know what text errors may be received, so I'd like to try to verify that numbers were received. Is this possible?
I had considered a simple IF statement for each variable, but that seems clumsy. For example:
if (value1 > -9999) and (value1 < 9999):
...
I'd have to do this for each of the three values. Is there a simpler way?