pygame draw rect(windowsurfacered(textrect left textrect top textrect width textrect height ) get pixel array of the surface pixarray pygame pixelarray(windowsurface pixarray[ ][ black del pixarray draw the text onto the surface windowsurface blit(texttextrect draw the window onto the screen pygame display update( run the game loop while true for event in pygame event get() if event type =quit pygame quit( sys exit(running the hello world program when you run this programyou should see new window appear which looks like figure - what is nice about using window instead of console is that the text can appear anywhere in the windownot just after the previous text you have printed the text can be any color and size the window is like blank painting canvasand you can draw whatever you like on it importing the pygame module let' go over each of these lines of code and find out what they do import pygamesys from pygame locals import