Created
March 3, 2017 17:55
-
-
Save ericabell/77b667b66b1ed89ecb040cf39835b098 to your computer and use it in GitHub Desktop.
fix word wrap in file
This file contains hidden or 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 | |
f = open('sample_input_text.asc','r') | |
contents = f.read() | |
split_contents = contents.splitlines() | |
for line in split_contents: | |
dedent_line = textwrap.dedent( line ) | |
print( textwrap.fill(dedent_line, width=60)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment