JPython Syntax errors

Steve Holden sholden at holdenweb.com
Thu Sep 7 14:16:39 EDT 2000


Have you tried running tabnanny.py (from the distributed tools) on
your code?  Could be you're mixing tabs and spaces, giving Python
a headache.

Python ALWAYS acts as though tabstops were every 8 positions.

regards
 Steve

raoval at auto-trol.com wrote:
> 
> I am new to JPython. I am trying to write a simple JPython script and
> want to call it from my Java class. The following is my script program
> (file name is Fibonacci.py):
> 
> import java
> 
> class Fibonacci:
>   def Multiply(self, num1, num2):
>         "@sig public int Multiply(int num1, int num2)"
>         self.result = num1*num2
>         return self.result
> 
> When I try to compile this using JPythonc bat file that came with the
> JPython installer, I am getting the following error:
> 
> at line: self.result = num1*num2
> Syntax error: inconsistent dedent
> 
> If I comment out "@sig public int Multiply(int num1, int num2)" line,
> it compiles fine, but I can't access Multiply function from my java
> class!
> 
> Any suggestions?
> 
> Thanks
> Rao
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.

-- 
Helping people meet their information needs with training and technology.
703 967 0887      sholden at bellatlantic.net      http://www.holdenweb.com/



More information about the Python-list mailing list