Skip to content

Instantly share code, notes, and snippets.

Created May 4, 2015 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/e9fd03ee67acdd435071 to your computer and use it in GitHub Desktop.
Save anonymous/e9fd03ee67acdd435071 to your computer and use it in GitHub Desktop.
fp_in = open(fileName, 'r')
fp_out = open(fileName, 'w')
with fp_in, fp_out:
prev_line = None
for line in fp_in.readlines():
if prev_line is None
prev_line = line
else:
fp_out.write(prev_line.replace(line))
prev_line = None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment