import unicodecsv as csv
from cStringIO import StringIO
csv_data="""some\new\path\version1,10
some\new\path\version2,20
some\new\path\version3,30"""
csvfile = StringIO()
csvfile.write(csv_data)
csvfile.seek(0)
reader = csv.reader(csvfile, delimiter=',')
for row in reader:
print row[0]
some
ew\pathersion1
some
ew\pathersion2
some
ew\pathersion3
str1 = "some\new\path\version1"
print myf.getvalue().encode('string_escape').replace(r'\\', r'\\'[:-1]).replace(r'\x0b', r'\v')
print myf.getvalue().encode('string_escape').replace(r'\\', r'\\'[:-1]).replace(r'\x0b', r'\v')