#-*- coding: utf -8 -*-
import pygame
blanco=(255,255,255)
tamaño=[640,480]
pygame.init()
pantalla=pygame.display.set_mode(tamaño)
terminar= False
reloj=pygame.time.Clock()
inicio=[]
while not terminar:
evento = pygame.event.wait()
if evento.type ==pygame.QUIT:
terminar=True
if evento.type == pygame.MOUSEBUTTONDOWN:
inicio=evento.pos
if evento.type == pygame.MOUSEBUTTONUP:
pygame.draw.line(pantalla, blanco,(inicio), (evento.pos), 5) #dibuja desde que presiona hasta que suelta el botón
pygame.display.flip()
reloj.tick(60)
pygame.quit()