Pygame It's cross platform Python modular , Designed for video games , Include images 、 voice . Based on the SDL On the basis of , Allow real-time video game development without having to be low-level language ( Such as machine language and assembly language ) Shackles , Is a highly portable module that can support multiple operating systems . Using it to develop small games is very suitable for .
pip install pygame
open pycharm Of PythonConsole, Then input
improt pygame
The successful installation will be shown as the following figure pygame Version number of .
Let's have a quick experience first pygame, Write a pygame The smallest system of . Use pycharm newly build py file , And enter the following code :
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygame
from pygame.