How to keep update the files using PYTHON
<pre><code>import os 
import glob
import CameraID
files = glob.glob('/tmp/image/*.png')
count = 1
while (count==1):
    for image in files:
        if ( not os.path.isfile(image)):
             print("Error: %s file not found" %image)
        else:
            print("Sending file %s ..." % image)
            print CameraID.run()
            print os.remove(image)
</code></pre>

<p>When I put the while loop, it will keep run and look for the old file instead the latest file. Anybody can help?</p>

<p>moves the line:</p>

<pre><code>files = glob.glob('/tmp/image/*.png')
</code></pre>

<p>into the <code>while loop</code> to keep that updated</p>

python python-2.7