Bill Janssen wrote: > > someone wrote: > > > Some languages have "picture" formats, where the structure > > of the format string more closely mimics that of the desired > > output. > > COBOL! From the snippet Steven posted about C#, it seems to have a > mode of "custom number formatting" which is picture-based.
A nice characteristic of a well-designed picture formatting system is that the pictures take up the same amount of space in the format string as the output they generate. So you can write things like headings = "Description Qty Price Amount" format = "AAAAAAAAAAAAAAA ###0 $#,##0.00 $#,###,##0.00" and visually check that the headings and columns will line up, without having to be concerned with the exact numbers of characters in each column. I think a picture-formatting function would be a nice thing to have as an alternative to %-formatting or whatever will replace it. And-then-we-can-call-it-PyBol-3000-ly, -- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | [EMAIL PROTECTED] +--------------------------------------+ _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com