Stumped by numerical values only error

Hi,

I am new to python and trying to run a script and get a input numerical values only even though they are. Any guidance on where I might look for the issue or how to resolve it?

Any help would be appreciated.

squish_velocity.py

        except:
            mb.askretrycancel("Error", "Input numerical values only.", icon=mb.ERROR, type="ok")

That’s catching every possible exception and telling you they’re numerical errors. I’d suggest printing out the traceback so you can see what’s actually failing and track the issue down.

Your code can generate that error if any of the code in the function fails, not just when the inputs are not ‘numerical’. The try/except block which generates that message should only include the get operations which are converted to floats, not the rest of the initialize function.

Careful with bare except clauses. You probably only want to catch ValueError; doing so will avoid this problem in the future. See this Stack Overflow question.

Thanks all for the replies, Newbie here so can use all the help I can get.

I ran traceback and the issue was in the code for matplotlib.

Resolved by editing,

This, fig.canvas.set_window_title(‘Squish velocity’)

To this, fig.canvas.manager.set_window_title(‘Squish velocity’) and issue resolved.

Thanks again!