replace a word in a file
Using regular expression to find int or float

Please study about moduel re and regular expression grammer.
See,
http://goo.gl/sP9gGU
http://docs.python.org/2/library/re.html
http://goo.gl/8HStFg