title: How to have a python script print out the exact match in a txt file?
body: <p>I have a python script that takes user input, then searches a txt file and prints the line. However, when the user inputs a number that is apart of other numbers it will print out everything in relation.</p>
  <p>For example, if the user inputs STT1, but there is another line thats called STT12, 13, 14 etc. The script prints out each line since it has the number 1 in it. How would do I make the script only print out the exact match?</p>
  <p>Example Output</p>
  <pre><code>
  Please enter your area: TTT17
  Please enter STT name: STT1
  
  
  
  STT Location:
  
  TTT17 | STT1 | Floor 1 | Row 2 | Section 2
  
  
  
  
  STT Location:
  
  TTT17 | STT13 | Floor 1 | Row 22 | Section 2
  
  
  
  
  STT Location:
  
  TTT17 | STT14 | Floor 1 | Row 22 | Section 2
  
  
  
  
  STT Location:
  
  TTT17 | STT17 | Floor 1 | Row 42 | Section 2
  
  
  
  
  STT Location:
  
  TTT17 | STT18 | Floor 1 | Row 42 | Section 2
  
  </code></pre>
  <p>Example Code</p>
  <pre><code>
  def find_stt():
    with open('{}'.format(db_file), 'r') as f:
      find_flag = False
      for line in f.readlines():
        if line.startswith(area) and name in line:
          print(&quot;\n&quot; + &quot;\n&quot; + &quot;\n&quot; + color.BOLD + &quot;STT Location:&quot; + color.END +
                &quot;\n&quot; + &quot;\n&quot; + color.BOLD + ' '.join(line.split()) + color.END + &quot;\n&quot;)
          find_flag = True
      if not find_flag:
        failed_search()
  </code></pre>