pygame无法运行的问题

fmz 发布于 2013/05/10 20:11
阅读 1K+
收藏 0

#!/usr/bin/env python
 
background_image_filename = '\home\zp\pygame\HelloWorld\sushiplate.jpg'
mouse_image_filename = '\home\zp\pygame\HelloWorld\fugu.png'
 
import pygame
from pygame.locals import *
from sys import exit
 
pygame.init()
 
screen = pygame.display.set_mode((640, 480), FULLSCREEN,32)
pygame.display.set_caption("Hello, World!")
 
background = pygame.image.load(background_image_filename).convert()
mouse_cursor = pygame.image.load(mouse_image_filename).convert_alpha()
 
while True:
 
    for event in pygame.event.get():
        if event.type == QUIT:
            exit()
 
    screen.blit(background, (0,0))
 
    x, y = pygame.mouse.get_pos()
    x-= mouse_cursor.get_width() / 2
    y-= mouse_cursor.get_height() / 2
    screen.blit(mouse_cursor, (x, y))
 
    pygame.display.update()
        

上面这段程序具体在:http://eyehere.net/2011/python-pygame-novice-professional-1/

运行:

zp@zpeng:20:10 HellWorld$ sudo python Hello.py
Traceback (most recent call last):
  File "Hello.py", line 12, in <module>
    screen = pygame.display.set_mode((640, 480), FULLSCREEN,32)
pygame.error: Couldn't set console screen info


哪位大神能告诉小第怎么回事,这可是我的第一个pygame程序啊!

加载中
0
zhuang
zhuang
大侠你在什么环境下运行的程序啊
fmz
fmz
debian 7.0
0
zhuang
zhuang
额, 那就换成巨硬的系统,一下子就能运行的..
fmz
fmz
???
返回顶部
顶部