tags:

views:

69

answers:

1

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?

+1  A: 

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

except Exception, detail:
Bastien Léonard
@Bastien, 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
@goh: Consider opening a separate question for that.
Ignacio Vazquez-Abrams
@goh: ... and maybe mark this question as answered.
zovision
@zovision, thanks for reminder. Slipped my mind.
goh