1
2def strip_non_ascii(string):
3 ''' Returns the string without non ASCII characters'''
4 stripped = (c for c in string if 0 < ord(c) < 127)
5 return ''.join(stripped)
6
7
8test = u'éáé123456tgreáé@€'
9print test
10print strip_non_ascii(test)