Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #33055

Re: Printing characters outside of the ASCII range

Date 2012-11-09 15:39 -0600
From Andrew Berg <bahamutzero8825@gmail.com>
Subject Re: Printing characters outside of the ASCII range
References <3d4644f8-ab88-41c5-9a52-2a5678dd64c0@googlegroups.com> <mailman.3508.1352483285.27098.python-list@python.org> <99d5bd83-35ab-4801-b953-391c497c35bf@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.3518.1352497164.27098.python-list@python.org> (permalink)

Show all headers | View raw


On 2012.11.09 15:17, danielk wrote:
> I guess the question I have is: How do you tell Python to use a specific encoding for 'print' statements when I know there will be characters outside of the ASCII range of 0-127?
You don't. It's raising that exception because the terminal cannot
display that character, not because it's using the wrong encoding. As
Ian mentioned, chr() on Python 2 and chr() on Python 3 return two
different things. I'm not very familiar with the oddities of Python 2,
but I suspect sending bytes to the terminal could work since that is
what chr() on Python 2 returns.
-- 
CPython 3.3.0 | Windows NT 6.1.7601.17835

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Printing characters outside of the ASCII range danielk <danielkleinad@gmail.com> - 2012-11-09 09:17 -0800
  Re: Printing characters outside of the ASCII range Ian Kelly <ian.g.kelly@gmail.com> - 2012-11-09 10:34 -0700
  Re: Printing characters outside of the ASCII range Andrew Berg <bahamutzero8825@gmail.com> - 2012-11-09 11:39 -0600
  Re: Printing characters outside of the ASCII range Dave Angel <d@davea.name> - 2012-11-09 12:47 -0500
    Re: Printing characters outside of the ASCII range danielk <danielkleinad@gmail.com> - 2012-11-09 13:17 -0800
      RE: Printing characters outside of the ASCII range "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-11-09 21:34 +0000
        Re: Printing characters outside of the ASCII range danielk <danielkleinad@gmail.com> - 2012-11-09 13:46 -0800
          Re: Printing characters outside of the ASCII range Ian Kelly <ian.g.kelly@gmail.com> - 2012-11-09 15:10 -0700
            Re: Printing characters outside of the ASCII range danielk <danielkleinad@gmail.com> - 2012-11-11 05:42 -0800
              Re: Printing characters outside of the ASCII range Lele Gaifax <lele@metapensiero.it> - 2012-11-11 18:09 +0100
            Re: Printing characters outside of the ASCII range danielk <danielkleinad@gmail.com> - 2012-11-11 05:42 -0800
        Re: Printing characters outside of the ASCII range danielk <danielkleinad@gmail.com> - 2012-11-09 13:46 -0800
      Re: Printing characters outside of the ASCII range Andrew Berg <bahamutzero8825@gmail.com> - 2012-11-09 15:39 -0600
    Re: Printing characters outside of the ASCII range danielk <danielkleinad@gmail.com> - 2012-11-09 13:17 -0800
  Re: Printing characters outside of the ASCII range wxjmfauth@gmail.com - 2012-11-10 02:09 -0800
  Re: Printing characters outside of the ASCII range Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-11-11 15:40 +0100

csiph-web