python - Getting an invalid syntax error -
apologies in advance know simple problem. i'm total beginner python, have decided use write mapreduce doing sentiment analysis.
i have taken python file link: http://www.alex-hanna.com/tworkshops/lesson-6-basic-sentiment-analysis/ give me guidance , trying run it. code particular thing have problems is:
… if len(sys.argv) < 2: print "usage: avgnreduce.py " sys.exit(0) …
the error is:
if len(sys.argv) < 2: ^ syntaxerror: invalid syntax
i'm assuming basic problem resolve, despite googling don't know how i'm meant fix this. i've tried using colon instead of semi colon , have ensured ampersand correct copying over. ideas?
you're looking <
operator there instead of lt
. (lt
stands less operator in html, see this thread.)
if len(sys.argv) < 2: print "usage: avgnreduce.py " sys.exit(0)
Comments
Post a Comment