Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45198

Re: in need of some help regarding my rock paper scissors game

References <CAAQ2WQxR7yuQp3Mn+zb0zsMLW53sWaPw2sPOyca=L1PRyO5r1Q@mail.gmail.com>
Date 2013-05-12 13:03 -0700
Subject Re: in need of some help regarding my rock paper scissors game
From Benjamin Kaplan <benjamin.kaplan@case.edu>
Newsgroups comp.lang.python
Message-ID <mailman.1593.1368389003.3114.python-list@python.org> (permalink)

Show all headers | View raw


On Sun, May 12, 2013 at 12:33 PM, Alex Norton <ayjayn1101@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.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: in need of some help regarding my rock paper scissors game Benjamin Kaplan <benjamin.kaplan@case.edu> - 2013-05-12 13:03 -0700

csiph-web