I&#39;m writing a program with python that compiles a list of decorators from my company&#39;s source code.  I&#39;m new to python and need help with the following:<div>I&#39;m trying to make the program find &quot;.com&quot; in any lines and not include them in the list of decorators that gets returned.  THis is because I had the program look for the @ symbol to find the decorators and it returned email addresses in the list.  What I was thinking was to do something like this:</div>
<div>k = candidate_line.find(&quot;.com&quot;)</div><div>if k != -1:</div><div>     candidate_line != candidate_line</div><div><br></div><div>The problem is that I know this won&#39;t work because &quot;.com&quot; can&#39;t be in the last slot of the candidate line...  So far the part of my code that needs to be changed looks like this...</div>
<div><br></div><div><br></div><div><div><div>      #parse out the names of the decorators from those lines</div><div>        return_decorators= []</div><div>        for ele in subset_lines:</div><div>                candidate_line, line_number = ele</div>
<div>                candidate_line = candidate_line.strip()</div><div>                i = candidate_line.find(&quot;(&quot;)</div><div>                j = candidate_line.find(&quot;#&quot;)</div><div>               <span class="Apple-style-span" style="background-color: rgb(255, 255, 102);"> k = candidate_line.find(&quot;.com&quot;)</span></div>
<div>                #if () is in the last spot</div><div>                if i == -1:</div><div>                        #if () is in the last spot and the decorator is in a comment</div><div>                        if j == 0:</div>
<div>                                #get rid of ( and #</div><div>                                candidate_line = candidate_line[2:i]</div><div>                        #if () is in the last spot and the decorator is not in a comment       </div>
<div>                        elif j != 0:</div><div>                                candidate_line = candidate_line[1:i]</div><div>                #if there are not ()&#39;s in the last spot</div><div>                elif i != -1:</div>
<div>                        #if there are not ()&#39;s, but the decorator is in a comment</div><div>                        if j == 0:</div><div>                                candidate_line = candidate_line[2:]</div><div>
                        #if there are not ()&#39;s and the decorator isn&#39;t in a comment</div><div>                        elif j != 0:</div><div>                                candidate_line = candidate_line[1:]</div>
<div><span class="Apple-style-span" style="background-color: rgb(255, 255, 102);">                elif k in candidate_line:</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 102);">                        candidate_line != candidate_line</span></div>
</div></div>