pygame  
pygame
documentation
||  Home  ||  Help Contents  ||
 
|| CD || Channel || Font || Joystick || Rect || Sound || Surface ||
|| pygame || UserRect || cdrom || constants || cursors || display || draw ||
|| event || font || image || joystick || key || mixer || mixer_music ||
|| mouse || surfarray || time || transform || version ||

pygame.draw

Contains routines to draw onto a surface.
 
Note that all drawing routines use direct pixel access, so the surfaces must be locked for use. The draw functions will temporarily lock the surface if needed, but if performing many drawing routines together, it would be best to surround the drawing code with a lock/unlock pair.
line - draw a line on a surface
lines - draw multiple connected lines on a surface

line
pygame.draw.line(Surface, color, startpos, endpos, width=1) -> Rect
 
lines
pygame.draw.lines(Surface, color, closed, point_array, width=1) -> Rect