So I’m trying to write the following script to check if a Table contains no data:
x = str(event.source.parent.getComponent(‘Table 1’).data)
y = ‘Dataset [0R ⅹ 2C]’
if x == y:
print “Works”
else:
print “Doesn’t Work”
But even though the x and y equal exactly the same thing it still doesn’t execute correctly and prints “Doesn’t Work”. Any Idea what I’m doing wrong? Thanks for your help!
Instead of trying to compare strings like that, just convert the data to a pyData set and look at the length. That is a better way of doing it anyway. Try something like this: