[Tutor] Printing to file on one line

Ronan Lucio ronan at melim.com.br
Tue Sep 23 07:35:29 EDT 2003


> This is a portion of my program:
>
>  #print header for debits in debits file
>
> aba.write('0' + (' ' * 17) + string.zfill(d_batch, 2) + 'MET' + (' ' *
> 7) + conf_name.ljust(26) + conf_apca[:6] + conf_desc.ljust(12) +
> str(smdate) + '\r\n')
> a = '1' + a8f + a9f + ' ' + a3 + a4f + a5f + a6f + a1f + a2f + a10 +
> '00000000\r\n'
>  aba.write(a)
> The first write goes over two lines - I want it all on one line:
>
> 0                 32MET       PB Exports                 233381Payments
>   220903^M

I'm not so good in Python, but, it seems something should be
wrong or at least, weird.

Perhaps some character in the value returned by the function
conf_desc.ljust(12) is causing this behavior.

[]s
Ronan



More information about the Tutor mailing list