print a ... z, A ... Z, "\n"' in Python

Alex Martelli aleax at mac.com
Sat Mar 3 11:27:45 EST 2007


js  <ebgssth at gmail.com> wrote:

> I forgot to cc pythonlist...
> #####################
> 
> Thanks for you quick reply.
> 
> I didn't know any string constants.
> 
> >From Python Library reference, 4.1.1 String constants:
> 
> letters
>    The concatenation of the strings lowercase and uppercase described below.
>   The specific value is locale-dependent, and will be updated when
> locale.setlocale() is called.
> 
> Great...

If you want to ensure ASCII is used independently of the locale, that's
what string.ascii_letters (and string.ascii_lowercase &c) is for.


Alex



More information about the Python-list mailing list