Created
September 20, 2016 17:54
-
-
Save ninijay/6191b6c6470e7817b9553a861079c479 to your computer and use it in GitHub Desktop.
textwrap shorten created by ninijay - https://repl.it/DdpX/1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import textwrap | |
# standard Paragraph | |
# width = 12 | |
para = "Hello World!" | |
print("Normal Paragraph:\n" + para + "\n") | |
# shorten | |
print("textwrap.shorten(width -> 12) Paragraph:\n" + textwrap.shorten(para, width=12)) | |
print("textwrap.shorten(width -> 11) Paragraph:\n" + textwrap.shorten(para, width=11)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment