<s> import sys , random <EOL> from PySide import QtGui , QtCore <EOL> class Example ( QtGui . QWidget ) : <EOL> def __init__ ( self ) : <EOL> super ( Example , self ) . __init__ ( ) <EOL> self . setGeometry ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> self . setWindowTitle ( '<STR_LIT>' ) <EOL> def paintEvent ( self , e ) : <EOL> qp = QtGui . QPainter ( ) <EOL> qp . begin ( self ) <EOL> self . drawPoints ( qp ) <EOL> qp . end ( ) <EOL> def drawPoints ( self , qp ) : <EOL> qp . setPen ( QtCore . Qt . red ) <EOL> size = self . size ( ) <EOL> for i in range ( <NUM_LIT:1000> ) : <EOL> x = random . randint ( <NUM_LIT:1> , size . width ( ) - <NUM_LIT:1> ) <EOL> y = random . randint ( <NUM_LIT:1> , size . height ( ) - <NUM_LIT:1> ) <EOL> qp . drawPoint ( x , y ) <EOL> app = QtGui . QApplication ( sys . argv ) <EOL> ex = Example ( ) <EOL> ex . show ( ) <EOL> app . exec_ ( ) </s>
