Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import textwrap
- from textwrap_example import sample_text
- dedented_text = textwrap.dedent(sample_text).strip()
- print textwrap.fill(dedented_text,
- initial_indent='',
- subsequent_indent=' ' * 4,
- width=50,
- )
- """ $ python textwrap_hanging_ident.py
- Traceback (most recent call last):
- File "textwrap_hanging_ident.py", line 10, in <module>
- width=50,
- File "/usr/lib/python2.7/textwrap.py", line 365, in fill
- w = TextWrapper(width=width, **kwargs)
- TypeError: __init__() got an unexpected keyword argument 'subsequent_ident'
- """
- # maybe using different version of python?
- ''' figured it out after running it through ipython
- it was a typo! Lines 8 & 9 should say indent instead of ident =]'''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement