Python And Pygame Porting Help


g_sus

Still Fresh
Joined
Nov 13, 2005
Messages
77
Age
33
Location
London
Website
Visit site
Im working on a leaping lemmings port (uses python and pygame), and when I try to run it on the gp2x (having redone controls and other whatnot), it goes to black then exits out. If i run it in sterm, something flashes about line 104, then sterm quits. Is there anyway to get python to log to a file?

Anywho, that probably will give few to no answers, so PM me if you want lemmings.py (26kb, so I wont post it here do to length)



EDIT: Spelling and reorganiztion of post
 
Im working on a leaping lemmings port (uses python and pygame), and when I try to run it on the gp2x (having redone controls and other whatnot), it goes to black then exits out. If i run it in sterm, something flashes about line 104, then sterm quits. Is there anyway to get python to log to a file?

Anywho, that probably will give few to no answers, so PM me if you want lemmings.py (26kb, so I wont post it here do to length)



EDIT: Spelling and reorganiztion of post

Sure, you can redirect standard error output to a file.

Assuming you're using a wrapper script lemmings.gpe to run this, try this in sterm:

lemmings.gpe >/mnt/sd/lemmings.log 2>&1

which redirects both standard output (print statements and the like) and standard error (where the python interpreter should be writing the errors) to a file.
 
Last edited by a moderator:
Alright, it ouputs

Code:
  File "./leaping.py", line 404
    stick.init() 
    ^
SyntaxError: invalid syntax

The thing is, stick.init() is a line I used from the wiki to initilize the joystick. Is there something else I have to add (i have the header file and what not already)
 
Probably anyone seriously developing for the GP2X under linux could benifit greatly from connecting to it over a serial line, especially for their first few tries, where all they're likely to get is a black screen or a swift return to the menu...
So, see the relevant thread:http://www.gp32x.de/board/index.php?showtopic=24053 and set up yours using the usb cable that came with the device.. You can then just use simple fprintf(stderr,...) statements to help with problem finding, (and see the ones already included in the sdl-libs).

P.
 
Last edited by a moderator:
Alright, it ouputs

Code:
  File "./leaping.py", line 404
    stick.init() 
    ^
SyntaxError: invalid syntax

The thing is, stick.init() is a line I used from the wiki to initilize the joystick. Is there something else I have to add (i have the header file and what not already)

Have you created an object called 'stick' first? A line something like:

Code:
stick = pygame.joystick.Joystick(0)

I don't what wiki you're talking about, so I can't go and look. If you'd like to email the python code to me at bjimba@jimr.us, I'll try to run it here. I've got the USB-serial connection set up already. But luteijn is right, you really should look into setting that up yourself to do any development.
 
Last edited by a moderator:
Back
Top