【问题标题】:insert paragraph with pillow python用枕头蟒插入段落
【发布时间】:2020-12-14 00:28:31
【问题描述】:

假设我有一个给定的字符串

x = "testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing"

然后使用 Pillow,我想将其作为段落插入到带有不可见框的图像上,以将文本引导到格式正确的位置。在我将附上的图像中,“不可见”的框以白色勾勒出来。参考 Image with outlined boxes for x to go into.

【问题讨论】:

    标签: python python-3.x image format python-imaging-library


    【解决方案1】:

    我相信我的问题的答案是 python 3.8 的 textwrap 功能的简单文本换行。现在放置带有 50 分隔符的换行文本会将其全部放入一个整齐换行的段落中。

    【讨论】:

      猜你喜欢
      • 2021-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多