dimanche 5 avril 2015

Python 'else' Statement - Invalid Syntax [on hold]

I'm brand new to Python and have been trying to set up a little display for my Murmur server.


I'm trying to complete the following but fail to figure out what's the issue.


Any help would be greatly appreciated! :)



usersnotauth=0
users=server.getUsers()
for key in users.keys():
if (users[key].userid == -1):
usersnotauth+=1

if users > 0:

lcd.set_cursor_position(0, 0)
backlight.rgb(255,255,255)
lcd.write("Online Users: %1" % users

else:

lcd.set_cursor_position(0, 0)
lcd.write("No Online Users")
backlight.rgb(0,0,0)


Error:



File "MurmurDisplay.py", line 81
else:
^
SyntaxError: invalid syntax

Aucun commentaire:

Enregistrer un commentaire