pygame basic question

ast nomail at
Tue Sep 8 11:33:59 CEST 2015


DISPLAYSURF = pygame.display.set_mode((400, 300))
pygame.display.set_caption('Hello World!')

The first line opens a 400x300 pygame window.
The second one writes "Hello World" on top of it.

I am just wondering how function set_caption finds the windows
since the window's name DISPLAYSURF  is not passed as
an argument

It would have understood something like:

DISPLAYSURF.set_caption('Hello World!')
pygame.display.set_caption(DISPLAYSURF, 'Hello World!')


More information about the Python-list mailing list