Egon Frerich wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> What do you have in the IDLE options - General - Default source encoding?
UTF-8
>
> Egon
>
> Kent Johnson schrieb am 12.04.2006 12:40:
>
>> [EMAIL PROTECTED] wrote:
>>> Hello again, I've investigated a little bit and th
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
What do you have in the IDLE options - General - Default source encoding?
Egon
Kent Johnson schrieb am 12.04.2006 12:40:
> [EMAIL PROTECTED] wrote:
>> Hello again, I've investigated a little bit and this is what I found:
>>
>> If I run IDLE and type
[EMAIL PROTECTED] wrote:
> Hello again, I've investigated a little bit and this is what I found:
>
> If I run IDLE and type
>
import sys
sys.stdin.encoding
>
> I get
>
> 'cp1252'
>
> But if I have a whatever.py file (it can even be a blank file), I edit
> it with IDLE, I press F5 (Ru
Hello again, I've investigated a little bit and this is what I found:
If I run IDLE and type
>>> import sys
>>> sys.stdin.encoding
I get
'cp1252'
But if I have a whatever.py file (it can even be a blank file), I edit
it with IDLE, I press F5 (Run Module) and then type:
>>> import sys
>>> sys.
[EMAIL PROTECTED] wrote:
> Martin v. Löwis wrote:
>> [EMAIL PROTECTED] wrote:
>>> This works if I use the console but gives the following error if I use
>>> IDLE:
>>>
>>> Traceback (most recent call last):
>>> File "C:\test.py", line 4, in ?
>>> text2 = unicode(raw_input(), sys.stdin.encoding
Martin v. Löwis wrote:
> [EMAIL PROTECTED] wrote:
> > This works if I use the console but gives the following error if I use
> > IDLE:
> >
> > Traceback (most recent call last):
> > File "C:\test.py", line 4, in ?
> > text2 = unicode(raw_input(), sys.stdin.encoding)
> > AttributeError: PyShe
The docs say that the encoding attribute is "New in version 2.3".
Python 2.2's IDLE produces exactly the exception reported by the OP.
Cheers,
John
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> This works if I use the console but gives the following error if I use
> IDLE:
>
> Traceback (most recent call last):
> File "C:\test.py", line 4, in ?
> text2 = unicode(raw_input(), sys.stdin.encoding)
> AttributeError: PyShell instance has no attribute 'encoding'
Fredrik Lundh wrote:
> [EMAIL PROTECTED] wrote:
>
> > Hello, the following program prompts the user for a word and tests to
> > see if it is the same as another one. If the user types "españa" (note
> > that the word contains an 'ñ'), the program should output "same". This
> > works if I run the co
(just for confirm)
Hi!
if the console is in cp1252, raw_input work OK with "ñ"
This (your) script :
# -*- coding: cp1252 -*-
import sys
text1 = u'españa'
text2 = unicode(raw_input(), sys.stdin.encoding)
if text1 == text2:
print 'same'
else:
print 'not same'
work OK with "chcp 8
[EMAIL PROTECTED] wrote:
> Hello, the following program prompts the user for a word and tests to
> see if it is the same as another one. If the user types "españa" (note
> that the word contains an 'ñ'), the program should output "same". This
> works if I run the code in IDLE but does not if I run
11 matches
Mail list logo