Lv.1
在 [Pygame Zero]初学者------PgZero 中回复
pygame创建屏幕方法:
# 导入库
import sys
import pygame
pygame.init() # 初始化pygame
size = width, height = 320, 240 # 设置窗口
screen = pygame.display.set_mode(size) # 显示窗口
# 执行喵循环,确保窗口一直显示
while True:
# 检查事件
for event in pygame.event.get(): # 遍历所有事件
if event.type == pygame.QUIT: # 如果单击关闭窗口,则退出
sys.exit()
pygame.quit() # 退出pygame
pygame zero创建屏幕方法:
import pgzrun
WIDTH = 300
HEIGHT = 300
pgzrun.go()
看到了没,这就是差别。
2020-02-21T17:58:59 点赞:2
在 Java(第三章)[编写第一个java程序][{helloworld} 中回复
突然觉得Python好简单:
print('hello world')
2020-07-14T14:00:20 点赞:0