osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


Thanks a lot :)

os.write(1, message)  works !

On Sun, Jan 28, 2018 at 8:04 PM, Dan Stromberg <drsalists at gmail.com> wrote:

> How about:
> >>> os.write(1, message)
>
> On Sun, Jan 28, 2018 at 4:51 PM, Jason Qian via Python-list
> <python-list at python.org> wrote:
> > print(repr(message))  out :
> >
> > *does not exist\r\n\tat com.*
> >
> >
> > for ch in message:
> >   printf("%d %c",ch, chr(ch))
> >
> >
> > %d %c 110 n
> > %d %c 111 o
> > %d %c 116 t
> > %d %c 32
> > %d %c 101 e
> > %d %c 120 x
> > %d %c 105 i
> > %d %c 115 s
> > %d %c 116 t
> >
> > *%d %c 13%d %c 10*
> > *%d %c 9*
> > %d %c 97 a
> > %d %c 116 t
> > %d %c 32
> > %d %c 99 c
> > %d %c 111 o
> > %d %c 109 m
>