Re: Detec nonascii in a string

2006-02-23 Thread Sebastian Bassi
On 2/23/06, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > "äöü".decode("ascii") > should do the trick -- you get an UnicodeError when there is anything ascii > can't encode. Thank you. This is good enought for me. Best regards, SB. -- Bioinformatics news: http://www.bioinformatica.info Lriser: ht

Re: Detec nonascii in a string

2006-02-23 Thread Tim Chase
> How do I detect non-ascii letters in a string? I want to detect the > condition that a string have a letter that is not here: > string.ascii_letters I don't know how efficient it is, but it's fairly clean: clean_string = ''.join([c for c in some_string if c in string.ascii_letters]) If you

Re: Detec nonascii in a string

2006-02-23 Thread Diez B. Roggisch
Sebastian Bassi wrote: > Hello, > > How do I detect non-ascii letters in a string? > I want to detect the condition that a string have a letter that is not > here: string.ascii_letters "äöü".decode("ascii") should do the trick -- you get an UnicodeError when there is anything ascii can't encode

Re: Detec nonascii in a string

2006-02-23 Thread Gerard Flanagan
Sebastian Bassi wrote: > Hello, > > How do I detect non-ascii letters in a string? > I want to detect the condition that a string have a letter that is not > here: string.ascii_letters > > Best regards, > SB. > > -- > Bioinformatics news: http://www.bioinformatica.info > Lriser: http://www.linspire

Re: Detec nonascii in a string

2006-02-23 Thread Steven D'Aprano
On Thu, 23 Feb 2006 12:32:35 -0300, Sebastian Bassi wrote: > Hello, > > How do I detect non-ascii letters in a string? > I want to detect the condition that a string have a letter that is not > here: string.ascii_letters for c in some_string: if c not in string.ascii_letters: raise V

Detec nonascii in a string

2006-02-23 Thread Sebastian Bassi
Hello, How do I detect non-ascii letters in a string? I want to detect the condition that a string have a letter that is not here: string.ascii_letters Best regards, SB. -- Bioinformatics news: http://www.bioinformatica.info Lriser: http://www.linspire.com/lraiser_success.php?serial=318 -- http