Hugomuc
Posts: 3
Joined: Fri Oct 18, 2013 7:14 am

Python-Games ditn't start

Fri Oct 18, 2013 7:29 am

Hello.
I'm new with Raspberry Pi and Python. I started with a Raspbian Image. There are some Pythongames on this installation, but they dont start.

The games are all installed in /home/pi/python_games. When I try to start a game, i.e. tetromino, "python tetronimo.py" I got a startmessage: "Press a key to play".
I press a key and get the message "...pats.cfg: No such file or directory".

I try to start tetromino in IDLE. Here I get the message: "Line 8 ImportError: No module named pygame"
Line 8 in tetromino.py is: "Import random, time, pygame, sys from pygame.locals.import".
So I installed pygame with apt-get install pygame..., but the games ditn't start.

Can anybody tell me, what is wrong or what is the correct way to start the pythonscripts from the raspbian image and how can I see, wether this are 2.7 or 3.x scripts.
Tnx Hugo

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Python-Games ditn't start

Fri Oct 18, 2013 9:24 am

It might not be anything you have done...

For a start, can you try firing up Python Games from the 'Big Raspberry' GUI screen? For me, that gives a list of games that can be played. Some (four in a row, slide puzzle) work, some (pentomino, tertomino) don't.

I hope this thread might alert the people who package stuff for the Raspbian image that these demos seem to be 'broken'?
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

Hugomuc
Posts: 3
Joined: Fri Oct 18, 2013 7:14 am

Re: Python-Games ditn't start

Fri Oct 18, 2013 9:35 am

Thanks!
Yes, I tryed to start the games from the GUI (startx) too. "four in a row", "slide puzzle") work, some (pentomino, tertomino) don't. The scripts won't work.
Greetings from Munich

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: Python-Games ditn't start

Fri Oct 18, 2013 4:33 pm

raspbian is missing the midi player needed to play the three tetris games

sudo apt-get update
sudo apt-get install timidity

should sort it.

Request to include timidity raised many moons ago. Seems stupid to have a set of example programs in a distribution for beginners that does not work.

https://github.com/asb/spindle/issues/57
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

Hugomuc
Posts: 3
Joined: Fri Oct 18, 2013 7:14 am

Re: Python-Games ditn't start

Sun Oct 20, 2013 1:59 pm

Tnx for help. Tetromino works now!

Return to “Python”