I have a python line that has
/c/hossam/fawzy/
this sentence
I want to replace all the forward slashes whenever they are found in a line, I am really wanting to use the replace method. so here is what I've done.. and I've reached the point when I print "Yeah Found" whenever I see it in the for loop, but can't figure out how to replace it.
import sys
file = open(r"E:\AutomationTestPath\t2.py", 'r+')
contents = file.read()
ListContents = list(contents)
print(ListContents)
SearchingFor = '/'
for letter in ListContents:
if SearchingFor in letter:
print("Yeah Found")