Question

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

This is still providing me with a left justified output. What am I doing wrong?

Was it helpful?

Solution

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

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

produce the desired output?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top