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

Jason Qian jqian at tibco.com
Sat Jan 27 21:23:02 EST 2018


there are 0D 0A 09

%c %d <class 'ctypes.c_long'> 116


*%c %d <class 'ctypes.c_long'> 13%c %d <class 'ctypes.c_long'> 10%c %d
<class 'ctypes.c_long'> 9*
%c %d <class 'ctypes.c_long'> 97


On Sat, Jan 27, 2018 at 9:05 PM, Dennis Lee Bieber <wlfraed at ix.netcom.com>
wrote:

> On Sat, 27 Jan 2018 20:33:58 -0500, Jason Qian via Python-list
> <python-list at python.org> declaimed the following:
>
> >      Ljava.lang.Object; does not exist*\r\n\t*at com
> >
>
>         Does that source contain
>
> 0x0d 0x0a 0x09
> <cr> <lf> <ht>
>
> or is it really
>
> 0x5c 0x72 0x5c 0x61 0x5c 0x74
> \    r    \    n    \    t
>
> as individual characters?
>
>
> >>> bks = chr(0x5c)
> >>> ar = "r"
> >>> en = "n"
> >>> te = "t"
> >>>
> >>> strn = "".join([bks, ar, bks, en, bks, te])
> >>> strn
> '\\r\\n\\t'
> >>> print strn
> \r\n\t
> >>> cstr = "\r\n\t"
> >>> cstr
> '\r\n\t'
> >>> print cstr
>
>
> >>>
>
> --
>         Wulfraed                 Dennis Lee Bieber         AF6VN
>     wlfraed at ix.netcom.com    HTTP://wlfraed.home.netcom.com/
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list