Created
November 3, 2015 14:24
-
-
Save ikarth/02a8cb4b95568d4362ca to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
# You may need to set the environment variable to output utf-8. | |
# On Windows, the command is: set PYTHONIOENCODING=utf-8 | |
# Or, more sensibly, you could rewrite this to write directly | |
# to a file rather than stdout | |
import sys | |
for line in open(sys.argv[1], mode='r', encoding="utf-8"): | |
if line.strip()=='': | |
print('\n') | |
else: | |
if line.isupper(): | |
print(line, sep='', end='') | |
else: | |
if line[:1]=="*": | |
print(line, sep='', end='') | |
else: | |
print((line.rstrip()), end=' ') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment