#!/usr/bin/env python3 # Größe der Surface (rechteckige Bildschirmfläche), kann # durch ein Paar (Breite, Höhe) in Pixeln angeben werden import pygame # initialize PyGame, includes pygame.display.init() pygame.init() # default size of the PyGame Surface = whole screen size1 = (pygame.display.Info().current_w,\ pygame.display.Info().current_h) # make PyGame Surface, size (width,height) in pixels pgs = pygame.display.set_mode( size=(600,400) ) # new size of the PyGame Surface < whole screen pgs_w = pgs.get_width() ; pgs_h = pgs.get_height() size2 = (pygame.display.Info().current_w,\ pygame.display.Info().current_h) # uninitialize PyGame (automatically when program exits) pygame.quit() # show size of the whole screen of the computer monitor print(" width of the whole screen:", size1[0]) print(" height of the whole screen:", size1[1]) # show size of PyGame Surface (area in the whole screen) print(" width of the PyGame Surface:", pgs_w) print("height of the PyGame Surface:", pgs_h) # show again size of PyGame Surface (with other methods) print(" width of the PyGame Surface:", size2[0]) print("height of the PyGame Surface:", size2[1])