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

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -