Last active
August 29, 2015 14:05
-
-
Save ColtonPhillips/2e74c870a0be91d4c60f to your computer and use it in GitHub Desktop.
Creates a pythonic list of strings from a simple text file, in attempts to save time for certain tasks.
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 pprint | |
pp = pprint.PrettyPrinter(indent=4) | |
with open('test.txt', 'r') as listFile: | |
lines = listFile.read().split("\n") | |
with open('out.py', 'a') as outFile: | |
outFile.write(pprint.pformat(lines)) |
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
['(a)', | |
'(()', | |
'I love it!', | |
'Hello blurb', | |
'(""")', | |
'\'"""\'', | |
'""', | |
'Noice"\'""\'', | |
'Colton said "Hello!" and then "fuck..."', | |
'""" """ """ """ """', | |
'""" """ """ """', | |
'""" """ """', | |
'""" """', | |
'"""', | |
'""', | |
'"""', | |
'""""', | |
'"""""', | |
'""""""', | |
'"""""""', | |
'""""""""', | |
'"""""""""', | |
'"""" """""', | |
''] |
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
(a) | |
(() | |
I love it! | |
Hello blurb | |
(""") | |
'"""' | |
"" | |
Noice"'""' | |
Colton said "Hello!" and then "fuck..." | |
""" """ """ """ """ | |
""" """ """ """ | |
""" """ """ | |
""" """ | |
""" | |
"" | |
""" | |
"""" | |
""""" | |
"""""" | |
""""""" | |
"""""""" | |
""""""""" | |
"""" """"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment