Take the 2-minute tour ×

Hi guys i got the following syntax error at the following line when i run my program in jython:

except Exception as detail:

SyntaxError: mismatched input 'as' expecting COLON

but on python its ok? What's wrong? I'm trying to use the stanford pos tagger api (java) in my python program.are there other ways?

share|improve this question
+1 for finally marking the right answer as "answered" –  Blauohr Jun 12 '10 at 11:26
add comment

1 Answer

up vote 6 down vote accepted

I guess it isn't supported by Jython yet, or you don't use the latest version. Try this:

except Exception, detail:
share|improve this answer
thanks for the prompt reply, it works! btw if i switch to jython from python, how do i use the custom libraries like nltk i've installed on python to work on jython... –  goh Jun 11 '10 at 7:41
@goh: Consider opening a separate question for that. –  Ignacio Vazquez-Abrams Jun 11 '10 at 8:20
@goh: ... and maybe mark this question as answered. –  zovision Jun 11 '10 at 8:46
@zovision, thanks for reminder. Slipped my mind. –  goh Jun 11 '10 at 9:27
add comment

Your Answer


