import os os.environ['SDL_VIDEO_WINDOW_POS'] = str(position[0]) + "," + str(position[1])
according to http://pygame.org/wiki/FrequentlyAskedQuestions
You can also simply center the screen with
import pygame, os os.environ['SDL_VIDEO_CENTERED'] = '1'
Note that this must be done before initializing pygame in the main loop. I do this right after importing os, for example. And since they are not part of pygame, you can probably use it elsewhere, although things like gtk and wxpython provide their own mechanisms.
Alan
source share