nn wrote:
To be more informative I am both writing text and binary data
together. That is I am embedding text from another source into stream
that uses non-ascii characters as "control" characters. In Python2 I
was processing it mostly as text containing a few "funny" characters.
OK. Then
Antoine Pitrou wrote:
> Le Tue, 23 Mar 2010 10:33:33 -0700, nn a écrit :
>
> > I know that unicode is the way to go in Python 3.1, but it is getting in
> > my way right now in my Unix scripts. How do I write a chr(253) to a
> > file?
> >
> > #nntst2.py
> > import sys,codecs
> > mychar=chr(253)
>
Steven D'Aprano wrote:
> I think your question is malformed. You need to work out what behaviour
> you actually want, before you can ask for help on how to get it.
It may or may not be malformed, but I understand the question. So let
eme translate for you. How can he write arbitrary bytes ( 0x0
Le Tue, 23 Mar 2010 10:33:33 -0700, nn a écrit :
> I know that unicode is the way to go in Python 3.1, but it is getting in
> my way right now in my Unix scripts. How do I write a chr(253) to a
> file?
>
> #nntst2.py
> import sys,codecs
> mychar=chr(253)
> print(sys.stdout.encoding)
> print(mycha
Steven D'Aprano wrote:
> On Tue, 23 Mar 2010 11:46:33 -0700, nn wrote:
>
> > Actually what I want is to write a particular byte to standard output,
> > and I want this to work regardless of where that output gets sent to.
>
> What do you mean "work"?
>
> Do you mean "display a particular glyph" o
Martin v. Loewis wrote:
> nn wrote:
> >
> > Stefan Behnel wrote:
> >> nn, 23.03.2010 19:46:
> >>> Actually what I want is to write a particular byte to standard output,
> >>> and I want this to work regardless of where that output gets sent to.
> >>> I am aware that I could do
> >>> open('nnout',
On Tue, 23 Mar 2010 11:46:33 -0700, nn wrote:
> Actually what I want is to write a particular byte to standard output,
> and I want this to work regardless of where that output gets sent to.
What do you mean "work"?
Do you mean "display a particular glyph" or something else?
In bash:
$ echo -e
nn wrote:
>
> Stefan Behnel wrote:
>> nn, 23.03.2010 19:46:
>>> Actually what I want is to write a particular byte to standard output,
>>> and I want this to work regardless of where that output gets sent to.
>>> I am aware that I could do
>>> open('nnout','w',encoding='latin1').write(mychar) but
Stefan Behnel wrote:
> nn, 23.03.2010 19:46:
> > Actually what I want is to write a particular byte to standard output,
> > and I want this to work regardless of where that output gets sent to.
> > I am aware that I could do
> > open('nnout','w',encoding='latin1').write(mychar) but I am porting a
nn, 23.03.2010 19:46:
Actually what I want is to write a particular byte to standard output,
and I want this to work regardless of where that output gets sent to.
I am aware that I could do
open('nnout','w',encoding='latin1').write(mychar) but I am porting a
python2 program and don't want to rewr
Gary Herron wrote:
> nn wrote:
> > I know that unicode is the way to go in Python 3.1, but it is getting
> > in my way right now in my Unix scripts. How do I write a chr(253) to a
> > file?
> >
>
> Python3 make a distinction between bytes and string(i.e., unicode)
> types, and you are still think
nn wrote:
I know that unicode is the way to go in Python 3.1, but it is getting
in my way right now in my Unix scripts. How do I write a chr(253) to a
file?
Python3 make a distinction between bytes and string(i.e., unicode)
types, and you are still thinking in the Python2 mode that does *NO
Rami Chowdhury wrote:
> On Tuesday 23 March 2010 10:33:33 nn wrote:
> > I know that unicode is the way to go in Python 3.1, but it is getting
> > in my way right now in my Unix scripts. How do I write a chr(253) to a
> > file?
> >
> > #nntst2.py
> > import sys,codecs
> > mychar=chr(253)
> > print
On Tuesday 23 March 2010 10:33:33 nn wrote:
> I know that unicode is the way to go in Python 3.1, but it is getting
> in my way right now in my Unix scripts. How do I write a chr(253) to a
> file?
>
> #nntst2.py
> import sys,codecs
> mychar=chr(253)
> print(sys.stdout.encoding)
> print(mychar)
The
I know that unicode is the way to go in Python 3.1, but it is getting
in my way right now in my Unix scripts. How do I write a chr(253) to a
file?
#nntst2.py
import sys,codecs
mychar=chr(253)
print(sys.stdout.encoding)
print(mychar)
> ./nntst2.py
ISO8859-1
ý
> ./nntst2.py >nnout2
Traceback (mo
15 matches
Mail list logo