Python 3 syntax error on raspbian but not on mac -


i thought python 3 code inter-operable, function raises syntax error on second line when run on raspbian / debian, not on mac.

def cleanstr(s):     toremove = dict.fromkeys((ord(c) c in u'\xa0\n '))     return s.translate(toremove) 

i'm confounded, function worked cleaning strings.

can suggest why not running ? difference of unicode syntax or differences in escaping?


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -