Creating formatted output using picture strings

donn donn.ingle at gmail.com
Wed Feb 10 14:00:57 EST 2010


On 10/02/2010 20:36, python at bdurham.com wrote:
> def picture(s, pic, placeholder='@'):
>      nextchar=iter(s).next
>      return ''.join(nextchar() if i == placeholder else i for i in pic)
Hell's teeth - even I understood that! Amazing solution.

\d

-- 
Fonty Python and Things! -- http://otherwise.relics.co.za/wiki/Software



More information about the Python-list mailing list