skaarr

July 15th, 2010, 09:32 PM

Teaching myself python and I've tried my best to solve figure this out but I can't see how it's done.

Using pygame

pygame.mouse.get_pos()

I get the mouse position on the pygame 'screen'.

This returns a pair of coordinates eg. (254, 43)

What I want to do is separate these two coordinates and but I can't figure out how I would do it using the basic string manipulation methods (especially as the values can be 1, 2 or 3 digits, meaning that the position of the data changes).

Any help much appreciated.

Using pygame

pygame.mouse.get_pos()

I get the mouse position on the pygame 'screen'.

This returns a pair of coordinates eg. (254, 43)

What I want to do is separate these two coordinates and but I can't figure out how I would do it using the basic string manipulation methods (especially as the values can be 1, 2 or 3 digits, meaning that the position of the data changes).

Any help much appreciated.