Help need

Steve Holden steve at holdenweb.com
Fri Nov 25 16:31:14 CET 2005


sr_sutar wrote:
> HI group,
> 
> During doing some codeing with python i got the inline error,
> 
> 
> def my_word( offset ):
>     try:
>     j = ord(t[offset]) + 256*ord(t[offset+1])# + 65536*ord(t
> [offset+2]) + 16777216*ord(t[offset+3])
>         #return j
>         except IndexError:
> #               print "Exception"
>     return j
> def my_bpp( mode ):
>         if mode & 0xF8000000:
>                 return 1 << ( ( (mode >> 27) & 31 ) - 1 )
>         if mode==20 or mode==27:
>                 return 4
>         return 0
> 
> 
> 
> File "../../../source/ant//tools/scripts/python/sprites.py", line 31
>     j = ord(t[offset]) + 256*ord(t[offset+1])# + 65536*ord(t
> [offset+2]) + 16777216*ord(t[offset+3])
>     ^
> IndentationError: expected an indented block
> make[2]: *** [swapped.out] Error 1
> make[1]: *** [ant_final_target] Error 2
> make: *** [rest] Error 2
> 
> 
> Any Help?
> 
The "except" clause requires an indented suite, which you've commented 
out. You might also want to look at the struct modlue if you want to 
convert 4 bytes into an integer.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/




More information about the Python-list mailing list