what is wrong with this python script
-
when I run this script the output is......nothing is there anything wrong
import os
import subprocessoutput = ("adc-exp 0|sed -e 's/A0 Voltage:[[:digit:]]*//' -e 's/ V//")
A = output
B = 2.10
if output.lower() in [B]:
myCmd = 'relay-exp 0 1'
elif output.upper() in [B]:
myCmd = 'relay-exp 0 1'
-
I wouldn't expect an output. There is no form of print used. Additionally there is no action on the device that would cause an output.
Here are some things to think about.
There is a text string expressed as a sole element of a tuple assigned to variable 'output'. Then that same tuple is assigned to variable 'A'. Then variable 'B' is declared as a float.
There is a question of the tuple being in a list of the integer, but that's not really a list as it has not been declared as such.
Is that enough to get you going on thinking through this? If not, get back to me.
Take care!
--Bill