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()              

 

posted @ 2020-03-13 09:26  什么都不会的小郭  阅读(126)  评论(0)    收藏  举报