I'm writing a python script that needs to act upon a change in dropbox. I have this:
UsersFile2 = "/home/pi/Dropbox-Uploader/dropbox_uploader.sh monitor /Lancaster"
call([UsersFile2], shell=True)
which successfully monitors it and then tell me in the command line that a file has changed, but how can I act upon this, the code just keeps checking for updates........... i think its more my understanding of python rather than dropbox
UsersFile2 = "/home/pi/Dropbox-Uploader/dropbox_uploader.sh monitor /Lancaster"
call([UsersFile2], shell=True)
UsersFile = "/home/pi/Dropbox-Uploader/dropbox_uploader.sh download /Lancaster/Updater.txt"
call([UsersFile], shell=True)
fileObject = open("Updater.txt", "r")
data = fileObject.read()
data_into_list = data.split(",")
ProblemName = data_into_list[0]
Mirroring = int(data_into_list[1])
if Mirroring == 1:
MirrorProblem = True
else:
MirrorProblem = False
if ProblemName != OldProblemName:
OldProblemName = ProblemName
SearchingByProblemName.Searching_By_Problem_Name(ProblemName,holds_list,original_holds_list,MirrorProblem,MirrorDic)
elif OldMirror != MirrorProblem:
OldMirror = MirrorProblem
SearchingByProblemName.Searching_By_Problem_Name(ProblemName,holds_list,original_holds_list,MirrorProblem,MirrorDic)
else:
pass
is the rest of the script, so once the Lancaster folder has changed I then want to read Updater.txt and go on
I've read lots of documents, I can keep downloading the document but thats not a great use of time