I have to replace certain characters in each tuple in a list.I know how to do it with just a basic string.
import string
s = 'This:is:awesome'
ss = s.replace(':', '/')
print ss
However, how would I go about looping through a list?
import string
finalPathList = []
pathList = ['List of 10+ file path names']
for lines in pathList:
ss = pathList.replace('\', '/')
print ss
finalPathList.append(ss)
All I need to do is go through each tuple of filenames, and replace all of the "\"
's with "/"
's.
Any help would be greatly appreciated!