from PyQt4.QtGui import * # create a QWidget to draw on app = QApplication([]) widget = QWidget() widget.resize(400, 400) widget.show() # create a QPainter painter = QPainter(widget) # draw a red circle at the origin painter.setPen(Qt.red) painter.drawEllipse(0, 0, 50, 50) # translate the origin by (100, 100) painter.translate(100, 100) # draw a blue circle at the translated origin painter.setPen(Qt.blue) painter.drawEllipse(0, 0, 50, 50) # end painting and show result painter.end() app.exec_()In this example, we create a QWidget to draw on and a QPainter to draw with. We draw a red circle at the origin (0,0) using the drawEllipse method. Then, we translate the painter by (100, 100) using the translate method. Finally, we draw a blue circle at the translated origin using the same drawEllipse method. Overall, the PyQt4.QtGui package provides a powerful set of tools for creating graphical user interfaces in Python, including the ability to draw on widgets and windows using the QPainter class.