Python3 - encoding issues

Benjamin Peterson benjamin at python.org
Sat Nov 28 21:51:48 EST 2009


DreiJane <joost <at> h-labahn.de> writes:
> Does anybody want to make a PEP from this (i won't do so) ?

I will answer this query with a little interactive prompt session:

$ python3
Python 3.1.1 (r311:74480, Nov 14 2009, 13:56:40)
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> data = b"Good, morning"
>>> data.startswith(b"Good")
True
>>> data.split(b", ")
[b'Good', b'morning']
>>> x = data.split(b", ")
>>> b", ".join(x)
b'Good, morning'

Bytes already have the basic string functions!






More information about the Python-list mailing list