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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -