python3 中英文混输的对齐问题

使用wcwidth这个模块
from wcwidth import wcswidth as wcs
def print_fix_width(s, n=20):
k = wcs(s) - len(s)
print(s.ljust(n-k," "), flush="")
参考文档
wcwidth的文档页 https://pypi.org/project/wcwidth/

from wcwidth import wcswidth as wcs
def print_fix_width(s, n=20):
k = wcs(s) - len(s)
print(s.ljust(n-k," "), flush="")
wcwidth的文档页 https://pypi.org/project/wcwidth/
ATscore
用常识解读世界,用自己的大脑独立思考
文章评论
Downloading the official app here was a breeze and the registration process took just seconds. I really appreciate how smoothly the slots run on my mobile device without any lag. Customer support responded quickly when I had a question about my welcome bonus. Give this platform a try and you will see why regular players keep coming back. <a href='https://aladdin99apk.org'>aladdin99apk</a>