If you don't need to handle quotes inside quotes, or anything like that, this is pretty easy. You could do it with regular expressions. But, since I'm guessing you don't know regexp (or you would have used it in the first place), let's do it with simple strings methods: split
your string on quote characters, then replace
only the even substrings, then join
it back together:
for line in fileinput.input( fileToSearch ):
bits = line.split('"')
bits[::2] = [bit.replace(textToSearch, textToReplace) for bit in bits[::2]]
tempFile.write('"'.join(bits))