I'm trying to make the condition that if the [0][0] entry in the array is not equal to 1 or 2 the program prints an error message. I can't get it to work, and I know it's because I can't get the logic correct.
try:
with open(input_script) as input_key:
for line in input_key.readlines():
x=[item for item in line.split()]
InputKey.append(x)
if InputKey[0][0] == 1 or 2: #This is where my condition is being tested.
print '.inp file succesfully imported' #This is where my success (or fail) print comes out.
else:
print 'failed'
except IOError:
print '.inp file import unsuccessful. Check that your file-path is valid.'