Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-31 Thread Juan Christian
Thank you my friend! It was line 48. The 'sorted()' method transformed my dict in a list. I do need this approach to put the keys in a sorted way, but know I do it directly, like 'fromComboBox.addItems(sorted(rates.keys()))' and 'toComboBox.addItems(sorted(rates.keys()))', so that I don't overwrit

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-31 Thread Juan Christian
Yes, the print, as I said, is DEBUG only. The way you said works: http://pastebin.com/bqCjNZGH Code: http://pastebin.com/9u2WCVat 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)

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-31 Thread Juan Christian
Let's see, the print is just "debug", it's not necessary in the program. 'row[0]' is the first element of the current row. Ex.: row = ['a', 'b', 'c', 'd'] - row[0] would be 'a' 'rates' is a dictionary, 'rates[row[0]]' would update the key row[0] in the dict with the 'value' I think that's it, ri

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-31 Thread Juan Christian
I'm changing so much the code that I got lost now. Code so far: http://pastebin.com/u4xwZuyJ I'm getting this error. 'value = float(row[-1])' is getting the values OK, but when I do 'rates[row[0]] = value' it screws things up. === Traceback (most recent call last): File

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Danny Yoo
> > 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() >

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Danny Yoo
On Sat, Aug 30, 2014 at 7:49 PM, Juan Christian wrote: > Let's see, the print is just "debug", it's not necessary in the program. > > 'row[0]' is the first element of the current row. Ex.: row = ['a', 'b', 'c', > 'd'] - row[0] would be 'a' > > 'rates' is a dictionary, 'rates[row[0]]' would update

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Danny Yoo
As the error message suggests, the problem might be near line 40. Look at lines 40 and 41 in your program. print(rates[row[0]] + " / VALUE : " + str(value)) rates[row[0]] = value Look at it very carefully, and try to explain to yourself what those two lines mean.

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Danny Yoo
Hi Juan, Wait, you are working with a CSV file, right? You should not be trying to parse this by hand if you can avoid it: there's a 'csv' parser library in the Standard Library. https://docs.python.org/3.1/library/csv.html So: import codecs import urll

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Danny Yoo
Hi Juan, Take out your try/except block. It's "lying" in the sense that what's problematic isn't the failure to download. The exception handling is not doing well: it's hiding the true cause of the problem. After you take the exception handler out, try again. The error message should be a lot

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Juan Christian
Sorry for double-post. I did as you said, now I get this: [image: Imagem inline 1] I did a 'print(line)' and it seems to be working, " b'# The daily noon exchange rates for major foreign currencies are published every business day at about 12:30' ". Code: http://pastebin.com/SgVdeKGm 2014-08-

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Juan Christian
I analyzed the code and found two mistakes: 1. I wrote 'startsWith', and not 'startswith' 2. I forgot to encode, I needed to use '.read().decode("utf-8")' rather than '.read()' only. This way I get the text correctly (http://pastebin.com/qy4SVdzK). I'm still analyzing the code and fixing things,

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Danny Yoo
> So the loop really should be: > > for line in fh.split("\n"): > ... Ah, apologies. Forgot that we're in Python 3 land. We have to be consistent with the types a lot more. This should be: for line in fh.split(b"\n"): ... Apologies. I should hav

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Danny Yoo
> Now the problem is another one... And NOT related to PySide, it's pure > Python. The problem is in the 'get_date()' func > (http://pastebin.com/mPhJcXmF) - I get all the text from bankofcanada site > but when I reach 'line.strip()' I get an error, "'int' object has no > attribute 'strip'". You'v

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Juan Christian
Ops, I'm sorry, didn't know about that, anyway I already fixed the issue. I was doing 'self.fromComboBox.currentIndexChanged().connect(self.update_ui)' instead of 'self.fromComboBox.currentIndexChanged.connect(self.update_ui)' - no parenthesis. Now the problem is another one... And NOT related to

Re: [Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Alan Gauld
On 30/08/14 14:19, Juan Christian wrote: Hello everyone, I have a question regarding PySide 1.2.2 and Python 3.4.1 The tutor list is for people learning Python language and the standard library so Side is really a bit off topic. There are some Qt users here though so you may get a reply, but

[Tutor] PySide 1.2.2 and Python 3 - "native Qt signal is not callable"

2014-08-30 Thread Juan Christian
Hello everyone, I have a question regarding PySide 1.2.2 and Python 3.4.1 I have this code that I made following a Python tutorial , mine is a bit different because the tutorial is a bit old, and I'm trying to use Python n