Re: print string as raw string

2009-02-17 Thread Miles
On Tue, Feb 17, 2009 at 2:01 PM, Scott David Daniels wrote: >>> Mirko Dziadzka schrieb: I'm trying to find a way to output strings in the raw-string format, e.g. print_as_raw_string(r"\.") should output r"\." instead of "\\." ... > > ... > The big issue I see is that lots of va

Re: print string as raw string

2009-02-17 Thread Scott David Daniels
Steven D'Aprano wrote: Diez B. Roggisch wrote: Mirko Dziadzka schrieb: I'm trying to find a way to output strings in the raw-string format, e.g. print_as_raw_string(r"\.") should output r"\." instead of "\\." ... In any case, this is just a variation of what repr() does. repr(r'\.') "'

Re: print string as raw string

2009-02-17 Thread Steven D'Aprano
Diez B. Roggisch wrote: > Mirko Dziadzka schrieb: >> Hi all >> >> I'm trying to find a way to output strings in the raw-string format, e.g. >> >> print_as_raw_string(r"\.") should output r"\." instead of "\\." >> >> Is there a better way than writing your own print function? Some magic >> encod

Re: print string as raw string

2009-02-17 Thread Mirko Dziadzka
Mirko Dziadzka wrote: > Hi all > > I'm trying to find a way to output strings in the raw-string format, e.g. > > print_as_raw_string(r"\.") should output r"\." instead of "\\." Ok, lets make a better example: >>> re_list = {} >>> re_list['foo'] = r'\..*' >>> re_list['bar'] = r'.*bar.*' >>> prin

Re: print string as raw string

2009-02-17 Thread Mirko Dziadzka
Diez B. Roggisch wrote: >> I'm trying to find a way to output strings in the raw-string format, e.g. >> >> print_as_raw_string(r"\.") should output r"\." instead of "\\." >> >> Is there a better way than writing your own print function? Some magic >> encoding? > > There is no need to do this. R

Re: print string as raw string

2009-02-17 Thread Diez B. Roggisch
Mirko Dziadzka schrieb: Hi all I'm trying to find a way to output strings in the raw-string format, e.g. print_as_raw_string(r"\.") should output r"\." instead of "\\." Is there a better way than writing your own print function? Some magic encoding? There is no need to do this. Rawstrings ar

Re: print string as raw string

2009-02-17 Thread Tino Wildenhain
Mirko Dziadzka wrote: Hi all I'm trying to find a way to output strings in the raw-string format, e.g. print_as_raw_string(r"\.") should output r"\." instead of "\\." Is there a better way than writing your own print function? Some magic encoding? Thats nonsense. print r"\." or in python3.0

print string as raw string

2009-02-17 Thread Mirko Dziadzka
Hi all I'm trying to find a way to output strings in the raw-string format, e.g. print_as_raw_string(r"\.") should output r"\." instead of "\\." Is there a better way than writing your own print function? Some magic encoding? Mirko -- http://mail.python.org/mailman/listinfo/python-list