我有一个名为消息字符串。
Message = "Hello, welcome!\nThis is some text that should be centered!"
是的,这只是一个测试语句...
而我试图居中的默认终端窗口,即80的宽度,这种说法:
print('{:^80}'.format(Message))
它打印:
Hello, welcome!
This is some text that should be centered!
我期待是这样的:
Hello, welcome!
This is some text that should be centered!
有什么建议?