tkp...@hotmail.com writes:

> Looking through the docs did not clarify my understanding of the
> issue. Why can I not split on '\t' when reading in binary mode?

You can split on b'\t' to get a list of byteses, which you can then
decode if you want them as strings.

You can decode the bytes to get a string and then split on '\t' to get
strings.

 >>> b'tic\ttac\ttoe'.split(b'\t')
 [b'tic', b'tac', b'toe']
 >>> b'tic\ttac\ttoe'.decode('utf-8').split('\t')
 ['tic', 'tac', 'toe']
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to