Python ctypes wrapper around SDL2
Clone or download
ahills and marcusva Check for window attribute on Window object close (#123)
Eliminates an exception when a Window is destroyed but the call to
SDL_CreateWindow has not yet happened.
Latest commit fa91007 May 24, 2018


About PySDL2

PySDL2 is a wrapper around the SDL2 library and as such similar to the discontinued PySDL project. In contrast to PySDL, it has no licensing restrictions, nor does it rely on C code, but uses ctypes instead.


PySDL2 is easy to install and integrate within your own projects. Just follow Python's standard procedure of installing packages or look for a prebuilt package for your operating system or distribution.


If you just started with SDL and PySDL2, it is strongly recommended that you read through the tutorial of the documentation to learn the basics. You can find the documentation at doc/html or online at

CI Environments

Linux, MacOS X:



This library is given to the public domain. There are no licensing restrictions. Please see doc/copying.rst for further details.