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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
  • 2021-09-23
  • 2021-11-04
猜你喜欢
  • 2021-12-16
  • 2021-06-03
  • 2022-01-01
  • 2021-10-29
  • 2022-01-22
  • 2021-11-14
  • 2021-06-19
相关资源
相似解决方案