input = open("first file.txt", "rt")
output = open("revised.txt", "wt")
for line in input:
output.write(line.replace("Bob", "James").replace("Xavier", "Jake"))
input.close()
output.close()
Now, this works but I have to manually add "first file.txt" to python and the program doesn't search the computers files. How would I make the program automatically search the computers files? Attached is a photo of where I have to drag in case your confused.