how to cut and paste in the windows of python(command line)

Jeroen Ruigrok van der Werven asmodai at in-nomine.org
Thu Jul 24 07:59:53 EDT 2008


-On [20080724 13:50], Fredrik Lundh (fredrik at pythonware.com) wrote:
>if you want better console support, consider installing the "ipython"
>shell:

Unless you work with non-ASCII. Ipython mangles non-ASCII unfortunately.

[Full UTF-8 environment]

In [1]: a = u'愛'
In [2]: a
Out[2]: u'\xe6\x84\x9b'

Normal python shell:

>>> a = u'愛'
>>> a
u'\u611b'

I wonder if it can be easily fixed with a getpreferredencoding() or by using
an .encode(sys.stdout.encoding or getpreferredencoding() or 'ascii',
'replace') triplet.

-- 
Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai
イェルーン ラウフロック ヴァン デル ウェルヴェン
http://www.in-nomine.org/ | http://www.rangaku.org/ | GPG: 2EAC625B
One who knows that enough is enough will always have enough...



More information about the Python-list mailing list