I want to Ignore an error, I tried using:
try: except: schema.
I’m using the
system.gui.transform(component=event.source, newWidth=100, duration=2000, callback=lambda: system.gui.transform(component=event.source, newWidth=200))
print ‘Do nothing’
But error persists
The lambda isn’t running in the context of the try. It’s running in the callback context. You’ll probably have to use a full function definition with a nested try: catch: construct instead of a lambda.
sir @pturmel. Can you please tell me how?
If I understood…
print ‘Do nothing and close def’
system.gui.transform(component=event.source, newWidth=100, duration=2000, callback=callbackCatch())
I already tried it but the callback never happens!!
Mr. @pturmel is there a difference between catch: and except:?
Thanks for reply!!
Sorry “catch” is what other languages use. Python uses “except”. I think your only mistake is putting a pair of parentheses on callbackCatch where you use it. When passing a function to be called later, leave off the parentheses.
And please edit your posts to use code formatting blocks, using triple backquotes, like so:
Thanks Mr. @pturmel, it works like a charm