GP32 Python Interface


racoon

Member
Joined
Nov 18, 2005
Messages
236
I am an absolute novice and quite unexperienced in programming. Nevertheless I'd like to create simple python apps (for example a shadowrun-dice calculator). Now I'd like to know what interface I could use, the only inbuilt I know of is turtle, and this is most certainly useless.

Shall I try Tk (if its inbuilt?) or another interface module/classes?
 
I am not even sure what features these libaries implement, so thanks theoddbot for all that gp2x-software-goodness you already brought us and keep your energies for more important tasks... thanks, I almost forgot there is pygame,I will look at the functions and stuff ;D. Thanks :)
 
Pygame is an extension of Python that adds in several libraries that makes implementing the most common elements in games (such as spirtes, blitting, etc...) easier by providing you the necessary classes so you don't have to write them yourself. You still need the base Python library to do anything with it though.

If you're just looking for some command-line programs to make a dice-roll generator, you can do that with just Python. Because Python is a higher-level programming language (automatic garbage collection, simplified syntax, no need to declare variables before using them, etc...), you can pretty much start off programming without having to learn how to create a template for the program. Think of it as BASIC that has the power (but not speed) of C/C++.
 
theoddbot posted on Mar 1 2006 at 10:10 PM said:
If its for the GP2X, you basically have to use PyGame, though I could port evas and imlib2 as well if you needed it.

I started a port of the EFL to the GP2X, but I couldn't get evas running... non-graphical stuff like ecore-timers and so, worked fine, but only in a blank screen...
I think is something related to gp2x framebuffer, but i don't know really... are you already into this?

tnks,
zako.
 
Last edited by a moderator:
The framebuffer driver was getting a divide by zero. I'm pretty sure the the framebuffer driver was returning 0 for the pixel clock rate. My solution is a hack but it was enough to play around with.

Starting at line 345 of evas_fb_main.c:
Code:
  if (hpix == 0)
      hpix = mode->width;

  if (lines == 0)
      lines = mode->height;

  printf("pixclock: %d\n", mode->fb_var.pixclock);

  if (mode->fb_var.pixclock)
      clockrate = 1000000 / mode->fb_var.pixclock;
  else
      clockrate = 40;

  printf("clockrate: %d, lines: %d, hpix: %d\n", clockrate, lines, hpix);
  mode->refresh = clockrate * 1000000 / (lines * hpix);
 
Tried your fix, but the same happens, if I use sterm to launch my test app i can see that ecore_evas_show() gets a NULL pointer, so ecore_evas_fb_new failed.
what parameters are you passing to that function? mine are (NULL, 0, 320, 240)
Tnks,
David.
 
topic:

I already told ppl on gp2xdev that command-line python programs dont work properly in sterm... they do not wait for raw_input() for example. Thats what I wonder about ;D

but I dont want to disturb your important E-port talk :)
 
Back
Top