string = "Special $#! characters spaces 888323 Kek ཌི ༜ 郭 ༜ དྀ "
Ergebnis sein sollte: "Specialcharactersspaces888323Kek 郭"Python 2.7 entfernen spezielle chac, Abstand ABER NICHT CHINESE CHARACTERS
ich versucht habe mit
print ''.join(c for c in string.decode('utf-8') if u'\u4e00' <= c <= u'\u9fff')
aber Fehler Rückkehr
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\encodings\utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeEncodeError: 'ascii' codec can't encode character u'\u90ed' in position 4 9: ordinal not in range(128)
meine Frage gleich wie Titel,
spezielle chac entfernen, Abstand ABER NICHT CHINESE CHARACTERS
wie über ich möchte nicht Symbol wie '$ # !? <>' @RomanPerekhrest –
Ausnahme Sonder Chac wie! @ # $%^& *(): "<> /. –
@ChinYe, zeige das erwartete Ergebnis gemäß deiner "Ausnahmeliste" – RomanPerekhrest