On this page
  1. textwrap.fill
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

textwrap.fill

Prev: textwrap.dedent | Up: textwrap | Next: textwrap.indent
Rel: textwrap.dedent, textwrap.indent, textwrap.shorten, textwrap.TextWrapper
Ref: docs.python.org — textwrap.fill
Tags: #public #python3 #stdlib #textwrap


Import

import textwrap
from textwrap import fill

Signature & Overview

textwrap.fill(text, width=70, **kwargs)

Fill a single paragraph of text, returning a new string.

Usage

import textwrap

assert textwrap.fill('hello world again', width=11) == 'hello world\nagain'

Gotchas

REPL Inspect

from textwrap import fill
help(fill)

Linked from

Related notes