Please help on print string that contains 'tab' and 'newline'

Dan Stromberg drsalists at gmail.com
Sun Jan 28 20:49:44 EST 2018


On Sun, Jan 28, 2018 at 5:35 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Sun, 28 Jan 2018 17:04:56 -0800, Dan Stromberg wrote:
>> How about:
>>>>> os.write(1, message)
>
> What do you think that will do that print() doesn't do?

>>> message = b'*does not exist\r\n\tat com.*'
>>> os.write(1, message)
*does not exist
        at com.*26
>>> print(message)
b'*does not exist\r\n\tat com.*'
>>>



More information about the Python-list mailing list