'Vertically center a text in a paragraph tag inside an 'absolute' positioned div
There is main div
Inside it a 'relative' positioned div
then there are two tags img and then an overlay div, which has a p tag
I cannot vertically the text inside the p tag
Solution 1:[1]
You can check to see if the file has changed at a given interval like so:
First, store the original version:
f = open('filename','r')
some_var = f.read()
f.close()
Then, set up a loop that will compare it at a given interval (here, ten minutes). I used the sched module, as per this answer: What is the best way to repeatedly execute a function every x seconds?
import sched, time
s = sched.scheduler(time.time, time.sleep)
def checkChange(sc, original, current):
if original != current:
# call the function that does your operation here!
s.enter(600, 1, checkChange, (sc,))
s.enter(600, 1, checkChange, (s,))
s.run()
This code is entirely untested, and probably doesn't work as intended. I just wanted to give you a logical path toward solving your problem. Also, it's likely faster to compare the hashes of the two files' contents, rather than their actual contents. Hope this helped!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Cameron Bond |
