Cool! Thanks to both Iliya and Peter!
On May 6, 7:34 pm, Peter Otten <__pete...@web.de> wrote:
> coldpizza wrote:
> > Hello,
>
> > I need to convert accented unicode chars in some audio files to
> > similarly-looking ascii chars. Looks like the following code seems to
> > work on windows:
>
> > im
coldpizza wrote:
> Hello,
>
> I need to convert accented unicode chars in some audio files to
> similarly-looking ascii chars. Looks like the following code seems to
> work on windows:
>
> import os
> import sys
> import glob
>
> EXT = '*.*'
>
> lst_uni = glob.glob(unicode(EXT))
>
> os.system
Try smth like this:
import unicodedata
def remove_accents(str):
nkfd_form = unicodedata.normalize('NFKD', unicode(str))
return u''.join([c for c in nkfd_form if not unicodedata.combining(c)])
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I need to convert accented unicode chars in some audio files to
similarly-looking ascii chars. Looks like the following code seems to
work on windows:
import os
import sys
import glob
EXT = '*.*'
lst_uni = glob.glob(unicode(EXT))
os.system('chcp 437')
lst_asci = glob.glob(EXT)
print sys