Last active
December 18, 2015 11:39
-
-
Save cluelesscoder/5777013 to your computer and use it in GitHub Desktop.
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 string | |
with open('C:\Documents and Settings\[trimmed]\Desktop\list.txt', | |
'rb') as infile: | |
fread = infile.readlines() | |
fread = [x.strip() for x in fread] | |
fread = [x.lstrip('\x95') for x in fread] | |
fread = [x.strip() for x in fread] | |
fread = [x for x in fread if x != ''] | |
fread = [x.replace(x,'[[' + x + ']]') for x in fread] | |
fread = (',').join(fread) | |
print fread | |
raw_input("Press any key to continue") |
Author
cluelesscoder
commented
Jun 13, 2013
Error that I get is:
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-4: end of string in escape sequence
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment