Lets take a look at the function definition:
pygame.draw.rect(Surface, Color, Rect, Thickness)
- Surface is a surface where you want to draw
- Color is a tupple with RGB values defining the color to be used
- Rect is a tupple in the format: (x,y,width,height)
- x,y are the coordinates of the upper left hand corner
- width, height are the width and height of the rectangle
- Thickness is the thickness of the line. If it is zero, the rectangle is filled.
Based on this, you shoud do something like:
redColor = (255,0,0)
pygame.draw.rect(screen, redColor, (mousepos[0], mousepos[1], 20, 20), 1)
Sources:
The official documentation for python.draw
can be found here:
http://www.pygame.org/docs/ref/draw.html
Mind the usefull Search examples for <function>
button under every function description, which can lead you to multiple real world examples of usage.
Useful tutorials can also be found on the official pages: http://www.pygame.org/wiki/tutorials
Other unofficial tutorials, like this one, can be found with a bit of Googling effort.