> Good evening! Does Python have a print function similar to Perl > format output (example below)? > format STDOUT = > @<<<<< @>>>> @<<<<<<<<<<<<<<<<<<< [EMAIL PROTECTED] [EMAIL PROTECTED] > $code, $date,$descript, $amt, $balance
This should be in a FAQ somewhere because it comes up a lot! There is no direct equivalent but very similar effects are achieved using triple quoted format strings with named parameters: format = ''' %-5(code)s %4(date)s %-20(descript)s $%9.2(amt)f $%9.2(balance)f''' Then when you print the string provide the builtin local variables dictionary as the feeder for the variable substitution. PS. The above string may not be exactly the same as your example - my Perl memory is fading fast... HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor