Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
output.write('{:>10}'.format(line[39:49]))
这仍然为我提供了左对齐的输出。我究竟做错了什么?
我随机猜测您的问题可能是什么。做
output.write('{:>10}'.format(line[39:49].strip())) # ^^^^^^^^
产生所需的输出?