{Spam?} [Tutor] IDLE vs. Python Command Line
Jeff Shannon
jeff at ccvcorp.com
Thu Jun 24 16:26:37 EDT 2004
Bob Gailer wrote:
> At 08:04 PM 6/17/2004, Dragonfirebane at aol.com wrote:
>
>> when i type:
>> ##
>> >>>import string
>> >>>string.letters
>> ##
>>
>> in IDLE, i get:
>> ##
>> 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\x83\x8a\x8c\x8e\x9a\x9c\x9e\x9f\xaa\xb5\xba\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff'
>> ##
>>
>> but when i do it on the Python Command Line, i get:
>> ##
>> 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
>> ##
>
> I can confirm that behavior, but not explain it.
My hunch is that this is Unicode (or at least Locale) related. The
"extra" characters reported under IDLE are all letters that are not
part of the standard American English character set, and are thus not
in ASCII. I'm presuming that the command line is reporting the ASCII
letters, and that IDLE is reporting a non-ASCII superset. Whether
this is an alternate codepage or a Unicode character set would
presumably depend upon the O.P.'s settings. (I don't have any grasp
on why IDLE would behave differently than the command line, though;
it's probably due to some sort of setting in IDLE, but I wouldn't know
where to look.)
Jeff Shannon
Technician/Programmer
Credit International
More information about the Tutor
mailing list