Warning/Error message in Python [SOLVED]

Hey there,

I’m starting a new topic as my question slightly drifted from the original one here derivative.ca/Forum/viewtop … 27&t=11114.

So the question now is quite simple:
How do I get access to the warning message of an operator in Python?

I tried with “op(‘/project1/Monitor/element0/moviefilein1’).warnings” but I get this reply “<built-in method warnings of td.moviefileinTOP object at 0x11cd330a8>”. Is there a way to count or get the error message/code of an operator in Python so that I can check programmatically that everything is fine?

Thanks a lot guys!

Also check the Error DAT.

That message is telling you warnings is a function. So you need to do warnings() to get the string out of it. It’ll be an empty string if there are no warnings.

1 Like

Thanks a lot!

Shame on me, indeed, addind the “()” works great!

Solution:
op(‘/project1/Monitor/element0/moviefilein1’).warnings()

Which returns the warning message, and empty if not warning.

:slight_smile: