[Tutor] A range of numbers
Daniel Ehrenberg
littledanehren at yahoo.com
Mon Dec 1 21:11:52 EST 2003
--- Leung Cris <krazie_mu_boi at hotmail.com> wrote:
> Forgot to tell you guys, if I don't get my mouse to
> the graphics screen, the mouse_position() will
> return None instead of a (x,y) . here's the error I
> wud get:
>
> Traceback (most recent call last):
> File "<pyshell#3>", line 1, in ?
> func()
> File "<pyshell#0>", line 6, in func
> x,y = mouse_position()
> TypeError: unpack non-sequence
Then catch the error. Here's just the unpacking part
of the code with the error caught:
try:
x, y = mouse_position()
except:
x, y = 0, 0
Daniel Ehrenberg
__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/
More information about the Tutor
mailing list