What does `if file.find('freq-') != -1` mean?
<p>I'm a chemistry student and want to write a script to extract some data (like coupling constants and interproton distance) from gaussian output files. </p>

<p>I found a script which extracts chemical shifts from gaussian output files. However, I don't understand what does <code>if file.find('freq-') !=-1</code> mean in the script.</p>

<p>Here's part of the script (since the script also does other things as well so I've just sown the bit relevant to my question):</p>

<pre><code>def read_gaussian_freq_outfiles(list_of_files):
    list_of_freq_outfiles = []
    for file in list_of_files:
        if file.find('freq-') !=-1:
            list_of_freq_outfiles.append([file,int(get_conf_number(file)),open(file,"r").readlines()])

    return list_of_freq_outfiles

def read_gaussian_outputfiles():
    list_of_files = []
    for file in glob.glob('*.out'):
        list_of_files.append(file)
    return list_of_files
</code></pre>

<p>I think in the <code>def read_gaussian_outputfiles()</code> bit, we create a list of file and simply add all file with extension '.out' to the list. </p>

<p>The <code>read_gaussian_freq_outfiles(list_of_files)</code> bit has probably list files which has "freq-" in the file name. But what does the <code>file.find('freq-')!=-1</code> mean? </p>

<p>Does it mean if whatever we find in the file name doesn't equal to -1, or something else? </p>

<p>Some other additional information: the format of the gaussian output filename is: <code>xxxx-opt_freq-conf-yyyy.out</code> where <code>xxxx</code> is the name of your molecule and <code>yyyy</code> is a number. </p>