Skip to content

Instantly share code, notes, and snippets.

@apex-omontgomery
Last active May 12, 2018 20:55
Show Gist options
  • Save apex-omontgomery/7a496376c5c7e176d062d4a4e3d51ef5 to your computer and use it in GitHub Desktop.
Save apex-omontgomery/7a496376c5c7e176d062d4a4e3d51ef5 to your computer and use it in GitHub Desktop.
"""
some_config.txt is the file
inside you have a value like
LASTSPECIFICVAL="222"
"""
def fileHasBeenupdated(file_name):
# check the file date to see if it's changed
"""
Implement this yourself.
"""
# return boolean
return True
def process_file(file_name, before_change):
after_change = ''
config_name = 'LASTSPECIFICVAL='
with open(file_name, 'r') as file:
"""
process file compare etc.
"""
while True:
file_name = 'some_config.txt'
curr_string = 'SOME CONFIG VALUE'
if fileHasBeenUpdated(f_name):
process_file(f_name, curr_string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment