[Zopyrus] A python IDE for teaching that supports cyrillic i/o
Max Belugin
mbelugin at gmail.com
Mon Nov 20 01:21:42 EST 2006
Есть еще PyDev (я не пробовал)
в SPE работает
# -*- coding: cp1251 -*-
print "тест"
но я не знаю как там вводить в raw_input - может быть, тоже бы получилось
Spe version
0.8.3.c
Python version
2.5 (2.3 required)
wxPython version
2.6.3.3. (2.6.1.0. required)
в C:\Python25\Lib\site.py разрешил использования кодировки из локали:
....
def setencoding():
"""Set the string encoding used by the Unicode implementation. The
default is 'ascii', but if you're willing to experiment, you can
change this."""
encoding = "ascii" # Default value set by _PyUnicode_Init()
#if 0:
if 1:
# Enable to support locale aware default string encodings.
import locale
loc = locale.getdefaultlocale()
if loc[1]:
encoding = loc[1]
if 0:
# Enable to switch off string to Unicode coercion and implicit
# Unicode to string conversion.
encoding = "undefined"
if encoding != "ascii":
# On Non-Unicode builds this will raise an AttributeError...
sys.setdefaultencoding(encoding) # Needs Python Unicode build !
...
On 11/18/06, Kirill Simonov <xi at gamma.dn.ua> wrote:
> Hi,
>
> Could anyone suggest me a simple IDE suitable for teaching Python as a
> first programming language to high school students? It is necessary
> that it has a good support for input/output in Cyrillic.
>
> Unfortunately, most IDEs I tried failed miserably in this respect. My
> test was simple: I've run the code
> name = raw_input("What's your name? ") # written in Russian
> print "Hello, %s!" % name # in Russian as well
> both from the shell and as a standalone script. This either caused a
> UnicodeError or just printed invalid characters.
>
> For the record, I've checked IDLE, PythonWin, Eric, DrPython, SPE, and
> WingIDE. The only ones that worked are WingIDE and IDLE (under Linux,
> but not under Windows).
>
>
> Thanks,
> Kirill
> _______________________________________________
> Русскоязычная группа пользователей Python и Zope: http://zope.net.ru
> Zopyrus at itconnection.ru
> http://itconnection.ru/cgi-bin/mailman/listinfo/zopyrus
> Архив рассылки http://itconnection.ru/pipermail/zopyrus/
> Zope FAQ: http://zope.net.ru/Zope/FAQ/
> Python FAQ: http://zope.net.ru/Python/FAQ/
>
--
Max Belugin, http://belugin.info , ICQ:9406811
More information about the Python-list
mailing list