How to confirm only html files exist in a given folder and if not then how to prompt the user to specify a folder with only html files within
<p>I would like to create a python script that will do 3 things: <li>1) Take user input to navigate to a file directory</li><li>2) Confirm the file contents (a particular set of files need to be in the folder for the script to proceed)</li><li>3) Do a Find and Replace</li></p>

<p>The Code as of now: </p>

<pre><code>import os, time
from os.path import walk

mydictionary = {"&lt;/i&gt;":"&lt;/em&gt;"}

for (path, dirs, files) in os.walk(raw_input('Copy and Paste Course Directory Here: ')):
    for f in files:
        if f.endswith('.html'):
            filepath = os.path.join(path,f)
            s = open(filepath).read()
            for k, v in mydictionary.iteritems(): terms for a dictionary file and replace
                s = s.replace(k, v)
            f = open(filepath, 'w')
            f.write(s)
            f.close()
</code></pre>

<p>Now i Have parts 1 and 3, I just need part 2.</p>

<p>for part 2 though I need to confirm that only html files exist in the directory the the user will specified otherwise the script will prompt the user to enter the correct folder directory (which will contain html files)</p>

<p>Thanks </p>
