if statement - Else Syntax Error Python -


if len(user_hash) > 0:   open(log_file, "w") log_f:     name in user_hash:         log_f.write("name:%s \n email: %s" % (name, email)      else len(user_hash) < 0:        print "nothing happened :(" 

i keep getting syntax error on else statement , unsure why keeps producing error. don't have other else statements in same def , still gives error. do?

your log_f.write statement missing trailing ')', confusing parser...and indentation doesn't right. cut , paste problem?


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -