Skip to main content

SettingWindowPosition — wiki

You can set the position of the window by using SDL environment variables before you initialise pygame. Environment variables can be set with the os.environ dict in python.

x = 100
y = 0
import os
os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (x,y)

import pygame
screen = pygame.display.set_mode((100,100))

# wait for a while to show the window.
import time
A full list of SDL environment variables can be found here:

newer link