0
output.write('{:>10}'.format(line[39:49]))

これはまだ左寄せの出力を提供しています。私は何が間違っているのですか?

4

1 に答える 1

2

I take a random guess at what your problem might be. Does

output.write('{:>10}'.format(line[39:49].strip()))
#                                       ^^^^^^^^

produce the desired output?

于 2012-03-06T20:04:18.920 に答える