Hi,<div>I'm trying to port a small library to Python 3.x, and I'm wondering what is the best way to port statements such as the one belows that are frequently found in network protocol implementation:</div><div><div>
<br></div></div><div><div> headerparts = ("%s:%s\n" % (key, value) for key, value in headers.iteritems())</div><div> framebytes = "%s\n%s\n%s\x00" % (command, "".join(headerparts), body) </div>
</div><div><br></div><div>Where all manipulated string are actually bytes, though value in headers dict may be any objects.</div><div><br></div><div>Baptiste.</div>