Skip to content

Instantly share code, notes, and snippets.

@Echocage
Last active August 29, 2015 14:14
Show Gist options
  • Save Echocage/15a6eef6d85b40ea4336 to your computer and use it in GitHub Desktop.
Save Echocage/15a6eef6d85b40ea4336 to your computer and use it in GitHub Desktop.
import time
def get_contents(file_name):
return open(file_name).readlines() # Return a list of the lines of text
last_version = get_contents('test.txt')
while True:
current_version = get_contents('test.txt')
if last_version != current_version: # Has it changed from what it was before?
print('Changes Made')
last_version = current_version
time.sleep(.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment