Last active
May 12, 2018 20:55
-
-
Save apex-omontgomery/7a496376c5c7e176d062d4a4e3d51ef5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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