On 2008-12-10, ajaksu [EMAIL PROTECTED] wrote:
On Dec 9, 5:24 pm, Bill McClain [EMAIL PROTECTED]
wrote:
On 2008-12-09, MRAB [EMAIL PROTECTED] wrote:
In Python 2.x unmarked string literals are bytestrings. In Python 3.x
they're Unicode. The intention is to make the transition from 2.x
On 10 Dec 2008 11:58:37 GMT, Bill McClain [EMAIL PROTECTED] wrote:
On 2008-12-10, ajaksu [EMAIL PROTECTED] wrote:
On Dec 9, 5:24 pm, Bill McClain [EMAIL PROTECTED]
wrote:
On 2008-12-09, MRAB [EMAIL PROTECTED] wrote:
In Python 2.x unmarked string literals are bytestrings. In Python 3.x
On Dec 10, 6:58 am, Bill McClain
[EMAIL PROTECTED] wrote:
On 2008-12-10, ajaksu [EMAIL PROTECTED] wrote:
On Dec 9, 5:24 pm, Bill McClain [EMAIL PROTECTED]
wrote:
On 2008-12-09, MRAB [EMAIL PROTECTED] wrote:
In Python 2.x unmarked string literals are bytestrings. In Python 3.x
On Dec 10, 10:06 am, [EMAIL PROTECTED] wrote:
On Dec 10, 6:58 am, Bill McClain
[EMAIL PROTECTED] wrote:
On 2008-12-10, ajaksu [EMAIL PROTECTED] wrote:
On Dec 9, 5:24 pm, Bill McClain [EMAIL PROTECTED]
wrote:
On 2008-12-09, MRAB [EMAIL PROTECTED] wrote:
In Python 2.x
On 2008-12-10, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I think this combination might do the trick (I don't have 2.6 to test
it right now):
from __future__ import print_function
from __future__ import unicode_literals
from functools import partial
import io
print = partial(print, sep=
On 2008-12-08, Bill McClain [EMAIL PROTECTED] wrote:
On 2008-12-08, Christian Heimes [EMAIL PROTECTED] wrote:
In this context 'str' means Python 3.0's str type, which is unicode in
2.x. Please report the misleading error message.
So this is an encoding problem? Can you give me a hint on
On Dec 9, 11:28 am, Bill McClain
[EMAIL PROTECTED] wrote:
On 2008-12-08, Bill McClain [EMAIL PROTECTED] wrote:
On 2008-12-08, Christian Heimes [EMAIL PROTECTED] wrote:
In this context 'str' means Python 3.0's str type, which is unicode in
2.x. Please report the misleading error message.
On 2008-12-09, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
This puzzles me too. According to the documentation StringIO accepts
both byte strings and unicode strings. Try to replace
output.write('First line.\n')
with
output.write(unicode('First line.\n'))
or
output.write(str('First
Bill McClain wrote:
I've just installed 2.6, had been using 2.4.
This was working for me:
#! /usr/bin/env python
import StringIO
out = StringIO.StringIO()
print out, 'hello'
I used 2to3, and added import from future to get:
#! /usr/bin/env python
from
On 2008-12-09, Peter Otten [EMAIL PROTECTED] wrote:
out = io.StringIO()
print(uhello, file=out, end=u\n)
out.getvalue()
u'hello\n'
That has the benefit of working. Thank you!
That can't be the intended behavior of print(), can it? Insering non-unicode
spaces and line terminators? I
Bill McClain wrote:
On 2008-12-09, Peter Otten [EMAIL PROTECTED] wrote:
out = io.StringIO()
print(uhello, file=out, end=u\n)
out.getvalue()
u'hello\n'
That has the benefit of working. Thank you!
That can't be the intended behavior of print(), can it? Insering non-unicode
spaces and line
On 2008-12-09, MRAB [EMAIL PROTECTED] wrote:
In Python 2.x unmarked string literals are bytestrings. In Python 3.x
they're Unicode. The intention is to make the transition from 2.x to 3.x
easier by adding some features of 3.x to 2.x, but without breaking
backwards compatibility (not
Bill McClain wrote:
On 2008-12-09, Peter Otten [EMAIL PROTECTED] wrote:
out = io.StringIO()
print(uhello, file=out, end=u\n)
out.getvalue()
u'hello\n'
That has the benefit of working. Thank you!
That can't be the intended behavior of print(), can it? Insering
non-unicode spaces
On Dec 9, 5:24 pm, Bill McClain [EMAIL PROTECTED]
wrote:
On 2008-12-09, MRAB [EMAIL PROTECTED] wrote:
In Python 2.x unmarked string literals are bytestrings. In Python 3.x
they're Unicode. The intention is to make the transition from 2.x to 3.x
easier by adding some features of 3.x to 2.x,
I've just installed 2.6, had been using 2.4.
This was working for me:
#! /usr/bin/env python
import StringIO
out = StringIO.StringIO()
print out, 'hello'
I used 2to3, and added import from future to get:
#! /usr/bin/env python
from __future__ import print_function
Bill McClain wrote:
I've just installed 2.6, had been using 2.4.
This was working for me:
#! /usr/bin/env python
import StringIO
out = StringIO.StringIO()
print out, 'hello'
I used 2to3, and added import from future to get:
#! /usr/bin/env python
from __future__
On 2008-12-08, Christian Heimes [EMAIL PROTECTED] wrote:
In this context 'str' means Python 3.0's str type, which is unicode in
2.x. Please report the misleading error message.
So this is an encoding problem? Can you give me a hint on how to correct in my
example? I see that io.StringIO() has
17 matches
Mail list logo