Skip to content

Instantly share code, notes, and snippets.

@solomon081
Created April 2, 2012 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save solomon081/2280171 to your computer and use it in GitHub Desktop.
Save solomon081/2280171 to your computer and use it in GitHub Desktop.
Custom Line Length
import textwrap
text = input("Enter in your text: ")
line = input("Enter in your line length: ")
try:
line = int(line)
except:
print("Invalid line value")
exit()
print(textwrap.fill(text, width=line))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment