Skip to content

Instantly share code, notes, and snippets.

@cluelesscoder
Last active December 18, 2015 11:39
Show Gist options
  • Save cluelesscoder/5777013 to your computer and use it in GitHub Desktop.
Save cluelesscoder/5777013 to your computer and use it in GitHub Desktop.
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")
@cluelesscoder
Copy link
Author

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