crimes in Python

Quinn Dunkan quinn at xeno.ugcs.caltech.edu
Wed Mar 8 13:35:14 EST 2000


On 08 Mar 2000 13:17:36 +0100, Martin von Loewis
<loewis at informatik.hu-berlin.de> wrote:
>  victim = Victim(fields)
>
>kragen at dnaco.net (Kragen Sitaker) writes:
>> 	sys.stdout.write(join (
>> 		(victim.crimeno,
>> 		victim.crime,
>> 		victim.type,
>> 		victim.age,
>> 		victim.sex,
>> 		victim.race),
>> 		"\t"))
>
>Here, it would be
>
>  sys.stdout.write(join(victim.fields, '\t'))
>
>I just noticed you have a different order here, so you'd probably use
>the accessors here.
>
>Regards,
>Martin

Or you could just write a __str__ for Victim and do print victim, 'etc.'



More information about the Python-list mailing list