Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/349.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python pygame.display.toggle_fulscreen()不工作_Python_Python 3.x_Pygame_Fullscreen_Traceback - Fatal编程技术网

Python pygame.display.toggle_fulscreen()不工作

Python pygame.display.toggle_fulscreen()不工作,python,python-3.x,pygame,fullscreen,traceback,Python,Python 3.x,Pygame,Fullscreen,Traceback,所以,我尝试让python切换到全屏,现在我想我需要做的就是: screen=pygame.display.toggle_fullscreen() 我觉得这已经足够好了 但是它给了我这个回溯错误: Traceback (most recent call last): File "C:/Users/pert/PycharmProjects/pygame/fullscreen.py", line 6, in <module> screen=pygame

所以,我尝试让python切换到全屏,现在我想我需要做的就是:

screen=pygame.display.toggle_fullscreen() 
我觉得这已经足够好了 但是它给了我这个
回溯
错误:

Traceback (most recent call last):
  File "C:/Users/pert/PycharmProjects/pygame/fullscreen.py", line 6, in <module>
    screen=pygame.display.toggle_fullscreen()
pygame.error
回溯(最近一次呼叫最后一次):
文件“C:/Users/pert/PycharmProjects/pygame/fullscreen.py”,第6行,在
screen=pygame.display.toggle_fullscreen()
pygame.error
请参阅以下文件:

在窗口模式和全屏模式之间切换显示窗口此功能仅适用于UNIX X11视频驱动程序。


Pygame Wiki上提供了一个解决方案

您能否提供有关代码的更多详细信息?这是完全错误回溯吗?不,这只是第6行(切换fulscreen行),所以,这是否意味着我只能在unix X11驱动程序上使用此函数?@pertifiedchicken是的。(举个简单的例子,它在我的Windows系统上不起作用)