Is there any way to make repr(aString) use double quotes?
Tim Evans
t.evans at paradise.net.nz
Wed Apr 9 07:43:59 EDT 2003
More information about the Python-list mailing list
Wed Apr 9 07:43:59 EDT 2003
- Previous message (by thread): Is there any way to make repr(aString) use double quotes?
- Next message (by thread): Is there any way to make repr(aString) use double quotes?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
tweedgeezer at hotmail.com (Jeremy Fincher) writes: > The topic really says it all -- I'd like to *force* repr(aString) to > use double quotes. Is that possible? > > If it's not, then is it possible to achieve the same thing (everything > escaped properly, etc.) through other means? > > Thanks, > Jeremy def drepr(s): return '"' + s.encode('unicode_escape').replace('"', '\\"') + '"' -- Tim Evans
- Previous message (by thread): Is there any way to make repr(aString) use double quotes?
- Next message (by thread): Is there any way to make repr(aString) use double quotes?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list