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


Groups > comp.lang.python > #45198 > unrolled thread

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

Started byBenjamin Kaplan <benjamin.kaplan@case.edu>
First post2013-05-12 13:03 -0700
Last post2013-05-12 13:03 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

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

FromBenjamin Kaplan <benjamin.kaplan@case.edu>
Date2013-05-12 13:03 -0700
SubjectRe: in need of some help regarding my rock paper scissors game
Message-ID<mailman.1593.1368389003.3114.python-list@python.org>
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.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web