in need of some help...

Ian Kelly ian.g.kelly at gmail.com
Tue Apr 30 19:02:51 EDT 2013


On Tue, Apr 30, 2013 at 4:30 PM, Alex Norton <ayjayn1101 at gmail.com> wrote:
> oh FYI its for my college course.. i didnt really want to use Visual Basic so the teacher cannot help

If the course is being taught in Visual Basic then that would probably
be the best thing to use.  I'm surprised that the teacher is allowing
you to complete the assignment in Python if he/she doesn't know the
language.

> basically i want to have it so that the element images in the GUI are linked with their corresponding variable(water with lblWater) and in the background the computer selects their own random integer and the results are displayed in the lblOutput.

I'm not all that familiar with PyQt specifically, but I can tell you
that GUI programs are typically event-based rather than simply
procedural like your RPS game.  That means that the "while 1" loop
that you have will be replaced with the Qt event loop.  You will also
need to write event handlers for each of the four element labels, so
that when a user clicks on one of them, the game will go through the
logic of receiving the player's choice (based on which one was
clicked), determining the result of the match, and finally updating
the output label accordingly.



More information about the Python-list mailing list