2025-09-10:仓库迁移

This commit is contained in:
2025-09-10 16:12:45 +08:00
parent e0e49b0ac9
commit 3130e336a1
146 changed files with 4066 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import textwrap
import os
if __name__ == '__main__':
words = ' '.join(["look", "into", "my", "eyes", "look", "into", "my", "eyes",
"the", "eyes", "the", "eyes", "the", "eyes", "not", "around", "the",
"eyes", "don't", "look", "around", "the", "eyes", "look", "into",
"my", "eyes", "you're", "under"])
print(words)
# 可以看到这样打印出来的字符串巨长无比如果想要控制行宽度就用textwrap模块
print(textwrap.fill(words, 70))
print(textwrap.fill(words, 40))
# 第二个参数width可以控制显示宽度如果是控制台输出你还能去找os.get_terminal_size()
# 注意由于未知原因这在pycharm中不好使2024.8.27
t_width = os.get_terminal_size().columns
print(t_width)
print(textwrap.fill(words, t_width))
# 用的应该不多在需要显示长字符串的时候去查textwrap库就行