diomoidapple
Posts: 2
Joined: Sat Apr 18, 2015 4:05 pm

python_games blank black screen

Sat Apr 18, 2015 4:14 pm

Hi, I am a complete noob to python, but I tried running one of the games in "python_games" that came with Rasbian. I ran

Code: Select all

python drawing.py
but after doing that all I have is a black blank screen. I cannot escape out of it in the normal ways I am used to (like ctrl-x, ctrl-d, etc.). Am I simply trapped and have to unplug and replug the raspberry pi, or is there some keystroke that I can press? Note that I am using Raspbian from the command line and did not run

Code: Select all

startx
.

User avatar
paddyg
Posts: 2541
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: python_games blank black screen

Mon Apr 20, 2015 1:54 pm

:( Yes, that's really annoying isn't it. I think most of the demos use pygame and it relies on the xserver to be running. I'm not sure what method of breaking you can resort to (often ctrl | will work where ctrl c doesn't, but not in this case).
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: python_games blank black screen

Mon Apr 20, 2015 4:28 pm

[CTRL]+[ALT]+[F2] gets you a new console where you can login and hit the hung process with some variant of the kill command.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
paddyg
Posts: 2541
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: python_games blank black screen

Mon Apr 20, 2015 6:07 pm

@dougie it's more annoying than that. It's really annoying! I think I have tried every combination of two or three keys (starting with CtrlAltFn) I can log in over ssh from another computer but a) that's slightly less convenient than power off/on b) ssh doesn't have the full root killing capacity of direct tty so can't fix it (can't even reboot or halt the system)
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: python_games blank black screen

Mon Apr 20, 2015 6:50 pm

paddyg wrote:@dougie it's more annoying than that. It's really annoying! I think I have tried every combination of two or three keys (starting with CtrlAltFn) I can log in over ssh from another computer but a) that's slightly less convenient than power off/on b) ssh doesn't have the full root killing capacity of direct tty so can't fix it (can't even reboot or halt the system)
Wow, that must be some very badly buggy code.

I wonder, if it ties the processor in a tight loop, would it be interruptible on a RPi2?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
paddyg
Posts: 2541
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: python_games blank black screen

Mon Apr 20, 2015 7:28 pm

It looks to be pretty standard pygame, which I used to think was fairly safe...

Same thing happens with RPi1 or RPi2; with python2 or python3.

Running this seems to block the terminal inescapably (and all the examples in python_games are similar)

Code: Select all

import pygame, sys
from pygame.locals import *

pygame.init()
DISPLAYSURF = pygame.display.set_mode((400, 300))
pygame.display.set_caption('Hello Pygame World!')
while True: # main game loop
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Return to “Python”