用法:
class textwrap.TextWrapper(**kwargs)
TextWrapper
構造函數接受許多可選的關鍵字參數。每個關鍵字參數對應一個實例屬性,例如wrapper = TextWrapper(initial_indent="* ")
是相同的
wrapper = TextWrapper() wrapper.initial_indent = "* "
您可以多次重複使用相同的
TextWrapper
對象,並且可以通過在使用之間直接分配給實例屬性來更改其任何選項。TextWrapper
實例屬性(以及構造函數的關鍵字參數)如下:TextWrapper
還提供了一些公共方法,類似於module-level 便利函數:
相關用法
- Python textwrap.indent用法及代碼示例
- Python textwrap.dedent用法及代碼示例
- Python textwrap.shorten用法及代碼示例
- Python tensorflow.eye()用法及代碼示例
- Python tensorflow.fill()用法及代碼示例
- Python tensorflow.math.special.dawsn()用法及代碼示例
- Python tensorflow.ensure_shape()用法及代碼示例
- Python tensorflow.math.special.fresnel_cos()用法及代碼示例
- Python tensorflow.raw_ops.Cos()用法及代碼示例
- Python tensorflow.get_logger()用法及代碼示例
- Python tensorflow.math.sqrt()用法及代碼示例
- Python test.support.catch_unraisable_exception用法及代碼示例
- Python tensorflow.math.atanh()用法及代碼示例
- Python tensorflow.math.xlogy()用法及代碼示例
- Python tensorflow.math.cos()用法及代碼示例
- Python tell()用法及代碼示例
- Python tensorflow.math.nextafter()用法及代碼示例
- Python tensorflow.math.floordiv()用法及代碼示例
- Python tensorflow.DeviceSpec.replace()用法及代碼示例
- Python tensorflow.math.confusion_matrix()用法及代碼示例
注:本文由純淨天空篩選整理自python.org大神的英文原創作品 textwrap.TextWrapper。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。