Attribute Error thrown every time i click a button named update in my GUI

Hi Everyone,
I’ve written a code to access & modify the DBC file using PyQt5.QtWidgets library. But whenever I click the update button Attribute error has been thrown. Can you guide me in this?
I’m little bit stuck in this situation.

ERROR:
self.signal.update(new_value)
^^^^^^^^^^^^^^^^^^
AttributeError: ‘Signal’ object has no attribute ‘update’

The error message tells you exactly what the problem is: The Signal class has no update method.

Your problem has nothing to do with PyQt5. The underlying library, which I suspect is cantools, is being called incorrectly.

Is this an application you wrote yourself?

Thanks for your response & support.

I didn’t say anything about PyQt5 causing the problem. Will try to call the cantools library.

Any reference code that you can help me with ?

There are examples at CAN BUS tools — cantools 38.0.2 documentation.

A general piece of advice: First make your code work without a GUI. Once it works to your satisfaction, then you can hook up a GUI to it.

2 Likes

Yeah sure, Already done that. It works fine. GUI too came along well but this attribute error hangs on to it along.

Strip out the exact code that gets run when you click the button on the GUI. See if that code, on its own, raises the same error. Whether it does or not, you will have a better idea of what the problem is.

1 Like