pygame basic question

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


Hi

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!')
or
pygame.display.set_caption(DISPLAYSURF, 'Hello World!')

thx


More information about the Python-list mailing list