pygame--图形模块

pygame安装:pip install -i http://pypi.douban.com/simple  pygame

pygame字典:http://www.pygame.org/docs/ref/display.html

导入pygame

import pygame

创建窗口

import pygame
pygame.init()
screen = pygame.display.set_mode([1000,700])

关闭屏幕

# _*_ coding: utf-8 _*_
import pygame,sys
pygame.init()
pygame.display.set_mode([1000,700])
while True:
    for i in pygame.event.get():        #获取时间
        if i.type == pygame.QUIT:       #判断事件类型 
            pygame.quit()             
            sys.exit()              

猜你喜欢

转载自www.cnblogs.com/python-cat/p/12484442.html