i am new to learning jython...
i just tried compiling a small piece of code that is given below:
def fac(x)
if x<=1:return 1
return x*fac(x-1)
on
C:\Program Files\jython\te mp>jythonc factor.py
it showed the following error:
processing factor
Traceback (innermost last):
File "C:\Program Files\jython\To ols\jythonc\jyt honc.py", line 5, in ?
File "C:\Program Files\jython\To ols\jythonc\mai n.py", line 298, in
main
File "C:\Program Files\jython\To ols\jythonc\mai n.py", line 219, in
doCompile
File "C:\Program Files\jython\To ols\jythonc\com pile.py", line 195, in
compilef
ile
File "C:\Program Files\jython\To ols\jythonc\com pile.py", line 209, in
compile
File "C:\Program Files\jython\To ols\jythonc\Src GenCompiler.py" , line
1079, in
execstring
File "<string>", line 1
def fac(x)
^
SyntaxError: invalid syntax
What may have gone wrong?
I am totally clueless as it is not mentioned in any of the books that I
tried.
i just tried compiling a small piece of code that is given below:
def fac(x)
if x<=1:return 1
return x*fac(x-1)
on
C:\Program Files\jython\te mp>jythonc factor.py
it showed the following error:
processing factor
Traceback (innermost last):
File "C:\Program Files\jython\To ols\jythonc\jyt honc.py", line 5, in ?
File "C:\Program Files\jython\To ols\jythonc\mai n.py", line 298, in
main
File "C:\Program Files\jython\To ols\jythonc\mai n.py", line 219, in
doCompile
File "C:\Program Files\jython\To ols\jythonc\com pile.py", line 195, in
compilef
ile
File "C:\Program Files\jython\To ols\jythonc\com pile.py", line 209, in
compile
File "C:\Program Files\jython\To ols\jythonc\Src GenCompiler.py" , line
1079, in
execstring
File "<string>", line 1
def fac(x)
^
SyntaxError: invalid syntax
What may have gone wrong?
I am totally clueless as it is not mentioned in any of the books that I
tried.
Comment