On 1/1/2012 4:11 PM, Miki Tebeka wrote:
s = "{0} {1} {2} {3}"
s.format(1, 2, 3, 4)
'1 2 3 4'
Or even
     In [4]: fmt = '{0} {1} {2} {3}'.format
     In [5]: print(fmt(1, 2, 3, 4))
     1 2 3 4

I have done this, except for using a more informative name, like 'emsg' for error message.
  except XError as e:
    print(emsg(a,b,c,e))
makes for pretty clear code.

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to