Python Forum
to strings or to bytes, that is the question - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: to strings or to bytes, that is the question (/thread-11417.html)



to strings or to bytes, that is the question - Skaperen - Jul-07-2018

when i convert control character representation to what it represents, should a function that does this return a string or return bytes (in python3)?

convertcc('^'+'M'+'\\'+'n') -> '\r\n'
vs
convertcc('^'+'M'+'\\'+'n') -> b'\r\n'
?