Re: How to only get \n for newline without the single quotes?

2018-02-24 Thread Ned Batchelder
On 2/24/18 2:08 PM, Peng Yu wrote: On Sat, Feb 24, 2018 at 12:45 PM, Wildman via Python-list wrote: On Sat, 24 Feb 2018 11:41:32 -0600, Peng Yu wrote: I would like to just get the escaped string without the single quotes. Is there a way to do so? Thanks. x='\n' print repr(x) '\n' Python 3

Re: How to only get \n for newline without the single quotes?

2018-02-24 Thread Peng Yu
On Sat, Feb 24, 2018 at 1:08 PM, Peng Yu wrote: > On Sat, Feb 24, 2018 at 12:45 PM, Wildman via Python-list > wrote: >> On Sat, 24 Feb 2018 11:41:32 -0600, Peng Yu wrote: >> >>> I would like to just get the escaped string without the single quotes. >>> Is there a way to do so? Thanks. >>> >>

Re: How to only get \n for newline without the single quotes?

2018-02-24 Thread Peng Yu
On Sat, Feb 24, 2018 at 12:45 PM, Wildman via Python-list wrote: > On Sat, 24 Feb 2018 11:41:32 -0600, Peng Yu wrote: > >> I would like to just get the escaped string without the single quotes. >> Is there a way to do so? Thanks. >> > x='\n' > print repr(x) >> '\n' > > Python 3.5.3 (defaul

Re: How to only get \n for newline without the single quotes?

2018-02-24 Thread Wildman via Python-list
On Sat, 24 Feb 2018 11:41:32 -0600, Peng Yu wrote: > I would like to just get the escaped string without the single quotes. > Is there a way to do so? Thanks. > x='\n' print repr(x) > '\n' Python 3.5.3 (default, Jan 19 2017, 14:11:04) [GCC 6.3.0 20170118] on linux Type "help", "copyri

How to only get \n for newline without the single quotes?

2018-02-24 Thread Peng Yu
I would like to just get the escaped string without the single quotes. Is there a way to do so? Thanks. >>> x='\n' >>> print repr(x) '\n' -- Regards, Peng -- https://mail.python.org/mailman/listinfo/python-list