On Apr 15, 2:07 pm, Kiuhnm <kiuhnm03.4t.yahoo.it> wrote: > This is the behavior I need: > path = path.replace('\\', '\\\\') > msg = ". {} .. '{}' .. {} .".format(a, path, b) > Is there a better way? >
A little more context would help. The quadruple-toothpick idiom predates Python. It's a little hard on the fingers and eyes at first, but it's pretty expressive--most people will clearly see that you are dealing with escaping issues. If you are just printing a message to the log, consider repr(). -- http://mail.python.org/mailman/listinfo/python-list