[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] root privileges when running pygame
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] root privileges when running pygame
- From: luke p <rabidpoobear@xxxxxxxxx>
- Date: Thu, 9 Jun 2005 13:29:04 -0500
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Thu, 09 Jun 2005 14:25:52 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=tJJhX5PyigS+c7IpGefY8WoSQf9tAo6JGlprJYNxiBT1kDR6AYMlNFvvs6SUgxUNSvv1olONiVRNIW1JH7f+ScnM0sGQT51cNk8NEivp6o3aOHxWKPoV2nrqwoMu1Z64yR/Ba+yjNZK5BTtvyz3+wsUX1WGYpeHlcsKNbK//KQY=
- In-reply-to: <42A85B28.4050102@web.de>
- References: <42A7E5A3.4000706@its.monash.edu.au> <42A85B28.4050102@web.de>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
ahhhh I see
you didn't call pygame.init()!
try this
import pygame
from pygame.locals import *
from time import sleep
pygame.init()
d=pygame.display.set_mode((500,500))
d.fill((255,255,0),(0,0,500,500)
time_to_exit = 0
while not time_to_exit:
for e in pygame.event.get():
if e.type == KEYDOWN:
if e.key == 27: #an escape
time_to_exit = 1
pygame.display.update()
also 500x500 is an odd resolution, if it's going to be fullscreen you
might want to use a 16/12 resolution like 640x480 or something...
to make it fullscreen the line would be
d = pygame.display.set_mode((640,480),FULLSCREEN)
I believe.
also the "fill" command I believe needs to have a rect argument of what to fill
it fills an area not the entire surface (unless the rect covers the
whole surface)
again this is all theoretical because I have to leave and don't have
time to test it.
good luck,
-Luke
On 6/9/05, Tobias Pfeiffer <BoteDesSchattens@xxxxxx> wrote:
> Hi!
>
> Darrell Stitt wrote:
> > I'm attempting to run pygame but it says:
> > pygame.error: Unable to open a console terminal
>
> Hm... why 'console terminal'?
>
> > when I run this I expect to see a yellow window. What I get is a
> > fullscreen with yellow only if I run this sudo or as root.
>
> You really mean 'fullscreen'?? Or only 'completely filled window'?
>
> > This is on my linux ppc. Using XP I get a yellow window.
>
> Usually, it's the other way around, because only the user who has
> started the X session is allowed to create windows in it, then not even
> root is allowed to. Is your X session running as root??
> What I observed, when I try to run your script as root under the
> user-owned X session, the monitor flickers (just like when changing
> resolution) and I get the following:
>
> > Xlib: connection to ":0.0" refused by server
> > Xlib: No protocol specified
> >
> > Xlib: connection to ":0.0" refused by server
> > Xlib: No protocol specified
> >
> > Traceback (most recent call last):
> > File "test.py", line 4, in ?
> > d=pygame.display.set_mode((500,500))
> > pygame.error: No video mode large enough for 500x500
>
> Maybe these problems are related / the same.
>
> Bye
> Tobias
>
> --
> Debian GNU/Linux Sarge has been released as stable!
> -- http://www.debian.de/News/2005/20050606
>
>
>