Perfect ... thanks.
>>> a = a.decode("string-escape")
Using "string-escape" does the trick!
Wonderful, this python. And the quick answers on this group.
--
http://mail.python.org/mailman/listinfo/python-list
bvdp wrote:
MRAB wrote:
bvdp wrote:
When reading lines of data from a file in the from (no quotes!)
foo\x20bar
and I assign to a variable in a line line like:
f = file('infile', 'r')
for a in f:
print a
the string is read in as string with the literal characters 'f', 'o'
... 'x'
MRAB wrote:
bvdp wrote:
When reading lines of data from a file in the from (no quotes!)
foo\x20bar
and I assign to a variable in a line line like:
f = file('infile', 'r')
for a in f:
print a
the string is read in as string with the literal characters 'f', 'o'
... 'x' , '2' ...
bvdp wrote:
When reading lines of data from a file in the from (no quotes!)
foo\x20bar
and I assign to a variable in a line line like:
f = file('infile', 'r')
for a in f:
print a
the string is read in as string with the literal characters 'f', 'o' ...
'x' , '2' ...
as compared t
When reading lines of data from a file in the from (no quotes!)
foo\x20bar
and I assign to a variable in a line line like:
f = file('infile', 'r')
for a in f:
print a
the string is read in as string with the literal characters 'f', 'o' ...
'x' , '2' ...
as compared to an assi