[Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"
Danny Yoo
dyoo at hashcollision.org
Sun Aug 31 05:27:19 CEST 2014
>
> Everything seems to be working, but, when I try to really use the program
> and convert something change the spinBox value I get:
>
>
> ###
> Traceback (most recent call last):
> File "C:/.../currency.py", line 20, in update_ui
> amount = (rates[from_] / rates[to]) * fromSpinBox.value()
> TypeError: list indices must be integers, not str
> ###
>
> What I have here is a DICT, not a LIST, why Python is reading it as a list?
> I do need to pass a str (the currency names) to get the values from the
> dict. I'm reading the doc trying to figure this out.
What statements affect the value of rates? Do a text search if you
have to. Search for anything that looks like "rates = "...
Believe the error message unless something very unusual is happening.
Usually, Python is telling you the truth. You _know_ you were
dealing with a dictionary earlier. And yet, you also know, from the
error message, that something has changed "rates" from a dictionary to
a list.
What statements in the program could have provoked this? I see at
least one in your program that probably will do it. I have no idea
what that particular statement is trying to do.
More information about the Tutor
mailing list