【发布时间】:2020-01-08 07:31:14
【问题描述】:
我正在尝试使用 pygame 在谷歌合作实验室中使用 pygame 编写游戏。我通过运行成功添加了pygame:
import os
!git clone https://github.com/ntasfi/PyGame-Learning-Environment.git
os.chdir('PyGame-Learning-Environment')
!pip install -e .
!pip install pygame
os.chdir('/content')
但是当我写这段代码时:
import pygame
pygame.init()
BLACK = [0,0,0]
size = [100,100]
screen = pygame.display.set_mode((size))
screen.fill(BLACK)
screen.update()
pygame.quit()
我收到以下错误消息:
Traceback (most recent call last)
<ipython-input-10-b26800e3009a> in <module>()
BLACK = [0,0,0]
size = [100,100]
screen = pygame.display.set_mode((size))
screen.fill(BLACK)
错误:没有可用的视频设备
有什么办法可以让 pygame 检测笔记本电脑屏幕吗?
【问题讨论】:
标签: python pygame chromebook