Re: [pygame] Strange "syntax error"

2007-03-05 Thread Luke Paireepinart

Charles Joseph Christie II wrote:

I have come to the decision that this idea would make a great sequel,
But for now I don't want to throw away the work I've already done. So,
without further ado...

I got hit with a syntax error, but I don't see it anywhere. Does
anybody see it?

It's on line 17. I don't see it though...


self.image.blit = (self.image, (0, 0)

One-open, two-open, one-close, uh-oh!
Missing parenthesis usually cause the line immediately after them to be flagged.
Don't always assume the line that Python tells you about is the one causing the 
problem.
HTH,
-Luke



Re: [pygame] Strange "syntax error"

2007-03-05 Thread Rikard Bosnjakovic

On 3/6/07, Charles Joseph Christie II <[EMAIL PROTECTED]> wrote:


It's on line 17. I don't see it though...


There were two attachements, so a hint of in which one the error
occured would be nice.

--
- Rikard.


[pygame] Strange "syntax error"

2007-03-05 Thread Charles Joseph Christie II
I have come to the decision that this idea would make a great sequel,
But for now I don't want to throw away the work I've already done. So,
without further ado...

I got hit with a syntax error, but I don't see it anywhere. Does
anybody see it?

It's on line 17. I don't see it though...

On Thu, 1 Mar 2007 21:14:10 -0500
"Charles Christie" <[EMAIL PROTECTED]> wrote:

> I know the basics of both Python and C, I took robotics and the
> robot's programming was done in C.
> I've learned how to use C but I've never actually done it, though.
> I've read code, went bug hunting and used code in a robot but I've
> never actually done something on my own in it yet.I know a little
> python from what I've been doing with my game so far. I'm just trying
> to think which direction I should take it. I had better make up my
> mind soon...
> 
> I'd like to experiment with SWIG and C... but I don't know if I have
> enough time for that. I'm afraid that if I do it wrong I'll waste too
> much time and have nothing good to present for my project...
> 
> Hmm. It's a difficult decision.
##Character class. This is where the main playable STG character actions will be defined.

import pygame
from pygame.locals import *
from helpers import *

class Charsprite(pygame.sprite.Sprite):
def __init__(self, pix, x, y):
pygame.sprite.Sprite.__init__(self)
self.update()
self.x = x
self.y = y
self.sprite = load_image(pix)
def update(self):
self.image = self.sprite
self.image.blit = (self.image, (0, 0)
self.rect = self.image.get_rect()
self.rect.center = (self.x, self.y)

##class Playersprite(Charsprite):
##def __init__(self):
##def update(self):
##
##
##class Bosssprite(Charsprite):
##def __init__(self):
##def update(self):
##
##
##class Lifebar(Charsprite):
##def __init__(self):
##def update(self):
##
##helpers.py - has all the stuff for importing images and sounds and other helpers I might want
import pygame, os, sys
from pygame.locals import *

def load_image(name, colorkey=None):
fullname = os.path.join('data', name)
try:
image = pygame.image.load(fullname)
except pygame.error, message:
print 'Unable to load ', name, '!'
raise SystemExit, message
image = image.convert()
if colorkey is not None:
if colorkey is -1:
colorkey = image.get_at((0,0))
image.set_colorkey(colorkey, RLEACCEL)
return image, image.get_rect()

def load_sound(name):
class NoneSound:
def play(self): pass
if not pygame.mixer:
return NoneSound()
fullname = os.path.join('data', name)
try:
sound = pygame.mixer.Sound(fullname)
except pygame.error, message:
print 'Unable to load ', wav, '!'
raise SystemExit, message
return sound


Re: [pygame] pygame.mixer crashes

2007-03-05 Thread �������
Rikard here it goes

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1480189728 (LWP 18930)]
0xa7ccd0e3 in strlen () from /lib/i686/libc.so.6
(gdb) bt
#0  0xa7ccd0e3 in strlen () from /lib/i686/libc.so.6
#1  0xa7653594 in open_file () from
/usr/lib/libSDL_mixer-1.2.so.0
#2  0xa765da72 in Timidity_Error () from
/usr/lib/libSDL_mixer-1.2.so.0
#3  0xa765e521 in Timidity_Init () from
/usr/lib/libSDL_mixer-1.2.so.0
#4  0xa763a3aa in open_music () from
/usr/lib/libSDL_mixer-1.2.so.0
#5  0xa76386f9 in Mix_OpenAudio () from
/usr/lib/libSDL_mixer-1.2.so.0
#6  0xa772060e in autoinit (self=0x0, arg=0xa7c2102c)
at src/mixer.c:184
#7  0xa7e22f2b in PyCFunction_Call () from
/usr/lib/libpython2.4.so.1.0
#8  0xa7dfaf89 in PyObject_Call () from
/usr/lib/libpython2.4.so.1.0
#9  0xa7e5698e in PyEval_CallObjectWithKeywords ()
   from /usr/lib/libpython2.4.so.1.0
#10 0xa7dfbad9 in PyObject_CallObject () from
/usr/lib/libpython2.4.so.1.0
#11 0xa7fd095a in init (self=0x0, args=0xa7c2102c) at
src/base.c:197
#12 0xa7e22f2b in PyCFunction_Call () from
/usr/lib/libpython2.4.so.1.0
#13 0xa7e5c367 in PyEval_EvalFrame () from
/usr/lib/libpython2.4.so.1.0
#14 0xa7e5cfd6 in PyEval_EvalCodeEx () from
/usr/lib/libpython2.4.so.1.0
#15 0xa7e5d045 in PyEval_EvalCode () from
/usr/lib/libpython2.4.so.1.0
#16 0xa7e776da in Py_CompileString () from
/usr/lib/libpython2.4.so.1.0
#17 0xa7e791f9 in PyRun_InteractiveOneFlags ()
   from /usr/lib/libpython2.4.so.1.0
#18 0xa7e79310 in PyRun_InteractiveLoopFlags ()
   from /usr/lib/libpython2.4.so.1.0
#19 0xa7e7943e in PyRun_AnyFileExFlags () from
/usr/lib/libpython2.4.so.1.0
---Type  to continue, or q  to quit---
#20 0xa7e7fa71 in Py_Main () from
/usr/lib/libpython2.4.so.1.0
#21 0x08048641 in main ()
(gdb)

Thank u guys 4 the replies

--- Rikard Bosnjakovic <[EMAIL PROTECTED]>
wrote:

> On 3/4/07, Ðáíáãéþôçò ÔóéìðÝñçò
> <[EMAIL PROTECTED]> wrote:
> 
> > In fact I don't think it's a mixer problem at all:
> [...]
> 
> Instead of python, issue "gdb python" and then
> "run". Then do the
> imports and the like you did above.
> 
> When you get SIGSEGV and return to gdb, type "bt"
> (backtrace) to see
> where the crash occurs.
> 
> 
> -- 
> - Rikard.
> 



 

The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php


Re: [pygame] error compiling pygame 1.7.2

2007-03-05 Thread James Mills
HI,

Yes after some playing around I found that SDL apps
were not working. So for some reason I had a broken X
configuration and libsdl didn't compile with X support.

I've since fixed this now. Thanks :)

Sorry about not quite giving the right compiler outout :)

cheers
James

-- 
--
-"Problems are Solved by Method"
-
- James Mills <[EMAIL PROTECTED]>
- HomePage: http://shortcircuit.net.au/~prologic/
- IRC: irc://shortcircuit.net.au#se

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


Re: [pygame] error compiling pygame 1.7.2

2007-03-05 Thread Marcus von Appen
On, Sun Mar 04, 2007, James Mills wrote:

> Hi all,
> 
> I have a problem compiling pygame on my box.
> Please see:
> http://prologic.shortcircuit.net.au/wiki/Paste/2007/03/05/00.08
> 
> Appreciate any feedback,

Great, you snipped the compiler line and did not provide any further
information about what was detected, etc.pp. My guess is that the X11
includes and libs are not setcorrectly. On FreeBSD we need an extra
patch due to different include directories. Did you check whether the
X11 includes are correctly set? If not, you might try the following
change in config_unix.py:

--- config_unix.py.orig Wed Aug 10 04:45:11 2005
+++ config_unix.py  Wed Sep 14 09:12:44 2005
@@ -52,6 +52,9 @@
 self.cflags += f + ' '
 elif f[:3] == '-Wl':
 self.cflags += '-Xlinker ' + f + ' '
+   if self.name == 'SDL':
+   inc = '-I/usr/X11R6/include'
+   self.cflags = inc + ' ' + self.cflags
 except:
 print 'WARNING: "%s" failed!' % command
 self.found = 0

Replace '-I/usr/X11R6/include' with your correct X11 include directory.

HTH
Marcus


pgpWNZxzujAXr.pgp
Description: PGP signature