On Sun, May 12, 2013 at 12:33 PM, Alex Norton <ayjayn1...@gmail.com> wrote:
> im new to python and im in the middle of making a RPS game for a college
> unit.
>
> i have used PyQt to create the GUI and i have received help regarding adding
> the code to the buttons.
>
> but its missing something as the error
>
> 'Traceback (most recent call last): File "C:\Users\Me\Desktop\testy.py",
> line 174, in bWater.clicked.connect( water_clicked ) AttributeError: 'int'
> object has no attribute 'clicked'' appears when i run the module.
>
> i was wondering if somebody could walk me through making the game complete
> and to add the results of the game (win/lose/stalemate) to the loutcome
> label
>
>  attached is the game file.
>
> --

bWater is an int. Integers don't have a clicked attribute. So
bWater.clicked.connect(water_clicked) looks for the clicked attribute
of the integer bWater, can't find it, and throws an error. Also,
Python scripts are executed line by line- at the time you make that
call, the water_clicked function doesn't exist yet, so even if that
was the correct call, it wouldn't work here.

I haven't used PyQT before so I can't say what the correct way to set
this up would be, but that's at least what's causing this error.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to