Edit: What you are asking is clearer now, refined my answer.
To get a file's contents:
def read_file(filename):
return open(filename).read()
And to write to a file:
def write_file(filename, toWrite):
file = open(filename, 'w')
file.write(toWrite)
file.close()
So to replace "web-iphone" with whatever the user typed in you could do:
Web = raw_input("Enter a value ")
Replaced = read_file("myfile.txt").replace("web-iphone", Web)
write_file("myfile.txt", Replaced)
For your comment:
newInput = raw_input("Enter a value ")
OldFile = read_file("myfile.txt")
value = OldFile.find("value"+6)
newFile = OldFile[:value] + newInput + OldFile[OldFile.find("\n",value+1):]