0
sample_text = '''
The textwrap module can be used to format text for output in
situations where pretty-printing is desired. It offers
programmatic functionality similar to the paragraph wrapping
or filling features found in many text editors.
'''
dedented_text = textwrap.dedent(sample_text)
wrapped = textwrap.fill(dedented_text, width=50)
final = textwrap.indent(wrapped, '> ')
print('Quoted block:\n')
print(final)
출력 인 경우 : 여분의 공간을 사용 textwrap.indent는()
> The textwrap module can be used to format text
> for output in situations where pretty-printing is
> desired. It offers programmatic functionality
> similar to the paragraph wrapping or filling
> features found in many text editors.
그냥 처음에 첫 번째 줄에 여분의 공간이 이유를 이해하려고?
'\n The textwrap module can be used to format text for output in\n situations where pretty-printing is desired. It offers\n programmatic functionality similar to the paragraph wrapping\n or filling features found in many text editors.\n '
주의 시작 부분에 \n
:
작성하셨습니다! 감사!! –